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

Exclamation marks are double escaped in upload-custom-translations #259

Closed
garethbowen opened this issue Oct 29, 2019 · 2 comments
Closed
Labels
Priority: 1 - High Blocks release eg supports new webapp feature Type: Bug Fix something that isn't working as intended
Projects

Comments

@garethbowen
Copy link
Member

garethbowen commented Oct 29, 2019

The translation files we export from POE and ship as default contain escaped exclamation marks, for example:

instance.upgrade.confirm.warning.text = This action cannot be undone, make sure your data has been backed up\!

On first run these are inserted into the database with _id messages-en and correctly unescaped, for example:

"instance.upgrade.confirm.warning.text": "This action cannot be undone, make sure your data has been backed up!",

If the files are uploaded through the admin UI the files are unescaped correctly.

However when I use upload-custom-translations the exclamation marks are double escaped and the backslash is rendered in the UI, for example:

"instance.upgrade.confirm.warning.text": "This action cannot be undone, make sure your data has been backed up\\!",

Reproduction

  1. Navigate to cht-core/ddocs/medic/_attachments
  2. Execute medic-conf --local upload-custom-translations replacing --local with the test instance as required.
  3. Go to App Settings > Upgrade Instance
  4. Pick a version and click "Upgrade" and wait for the dialog - don't submit the dialog!
  5. Notice the dialog message is: "This action cannot be undone, make sure your data has been backed up!" (NB: the backslash just before the exclamation mark).

Expected

The message should be "This action cannot be undone, make sure your data has been backed up!"

Original noticed in medic/cht-core#5392

@garethbowen garethbowen added Type: Bug Fix something that isn't working as intended Priority: 1 - High Blocks release eg supports new webapp feature labels Oct 29, 2019
@garethbowen garethbowen added this to To do in 3.8.0 via automation Oct 29, 2019
@tookam tookam self-assigned this Oct 31, 2019
@tookam tookam moved this from To do to In progress in 3.8.0 Oct 31, 2019
@garethbowen
Copy link
Member Author

Ready for AT in 259-exclamation-mark-double-escaped

@garethbowen garethbowen moved this from In progress to In AT in 3.8.0 Nov 3, 2019
@ngaruko
Copy link
Contributor

ngaruko commented Nov 13, 2019

LGTM
before

image

Using medic-conf branch (local):
image

ngaruko pushed a commit that referenced this issue Nov 13, 2019
 Removes double escaping

#259
@ngaruko ngaruko assigned ngaruko and unassigned tookam Nov 13, 2019
@ngaruko ngaruko closed this as completed Nov 13, 2019
3.8.0 automation moved this from In AT to Done Nov 13, 2019
@ngaruko ngaruko removed their assignment Nov 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: 1 - High Blocks release eg supports new webapp feature Type: Bug Fix something that isn't working as intended
Projects
No open projects
3.8.0
  
Done
Development

No branches or pull requests

3 participants