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

Add placeholders to translation forms #66

Merged
merged 2 commits into from Dec 13, 2018

Conversation

simonprev
Copy link
Member

Interpolations are strings automatically marked (based on the format) to
be replaced by the application at runtime. Those strings are meant to be
left unmodified and not translatable. The UI reflects that. The
interpolations shown to the user is always the master translation’s
ones. This is to clearly show on not translated content that maybe
interpolations uploaded after the correction were removed or added.

Closes partially #24. This does not allow user-defined regex or special input handling of the placeholders, but it could be done in the future.

In action

image

With a translated interpolation

image

Interpolations are strings automatically marked (based on the format) to
be replaced by the application at runtime. Those strings are meant to be
left unmodified and not translatable. The UI reflects that. The
interpolations shown to the user is always the master translation’s
ones. This is to clearly show on not translated content that maybe
interpolations uploaded after the correction were removed or added.
@simonprev simonprev changed the title Add interpolations to translation forms Add placeholders to translation forms Dec 13, 2018
@simonprev simonprev force-pushed the feature/extract-interpolations branch from f6e5dba to b989ce6 Compare December 13, 2018 00:38
@simonprev simonprev force-pushed the feature/extract-interpolations branch from b989ce6 to 1728adb Compare December 13, 2018 00:47
@simonprev simonprev merged commit c6dbc08 into master Dec 13, 2018
@simonprev simonprev deleted the feature/extract-interpolations branch December 13, 2018 00:57
@louim
Copy link
Contributor

louim commented Jan 21, 2019

Maybe not the best place to ask, but I just updated our Accent version. What would be the best way to generate placeholders for existing strings? Is there some kind of command I can run?

@simonprev
Copy link
Member Author

I came up with this simple script: https://gist.github.com/simonprev/6d65fc01d6b9dd9ae64cae9dc9fe8741

There is one thing it does not generate: previous_translation to handle operation rollback. But the script updates operations and translations correctly. It’s a little bit hackish and the best way would be to reupload your file but I tried it locally and it works

Be sure to replace the @regex and @document_id to fit your data 😄

@louim
Copy link
Contributor

louim commented Jan 22, 2019

@simonprev thanks, worked perfectly

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

Successfully merging this pull request may close these issues.

None yet

3 participants