Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to handle repeated/duplicated keys? #543

Open
seltix5 opened this issue Aug 6, 2019 · 2 comments
Open

how to handle repeated/duplicated keys? #543

seltix5 opened this issue Aug 6, 2019 · 2 comments
Labels

Comments

@seltix5
Copy link

seltix5 commented Aug 6, 2019

hello,
I found this tool and I think the idea is amazing! I was doing a implementation test and... when using this tool to translate text, how should I handle the repeated/duplicated keys in the page ?

for example, a table :
image

not only there wold be a problem with the post process to save the post data but also when I stop the tool only the last editable field is disabled :

image

any idea about how to approach this problem?

thanks!

@anthonyjb
Copy link
Member

Hey @seltix5 can you send me the HTML that's being generated? If you're using fixtures then I'd recommend just generating a key of the form my-key-prefix_{uuid}? We use dynamic keys for fixture data extensively without issue so hopefully this would be an option?

@seltix5
Copy link
Author

seltix5 commented Aug 7, 2019

hello,
this is the code generated in the example :
<lang style="display:inline-block;" data-fixture="" data-ce-tag="p" data-name="lang.translations.pt-PT.ecommerce.orders.waitingpayment" class="ce-element ce-element--type-text">A aguardar pagamento</lang>
But if I use that dynamic key they will be treated as different text, but they do are the same text.

For a quick fix from my side the only option I can see is control what keys are requested and ignore keys already requested and just return the text without the html for ContentTool.

A great option wold be to treat the fixture with the same key as equal, if one is updated the others are updated too with the same text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants