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

(Case 116917) error when changing password for user in french language #3980

Closed
dimagimon opened this issue Jul 31, 2014 · 3 comments · Fixed by #4149 or #4161
Closed

(Case 116917) error when changing password for user in french language #3980

dimagimon opened this issue Jul 31, 2014 · 3 comments · Fixed by #4149 or #4161

Comments

@dimagimon
Copy link
Collaborator

  1. Go to account settings and change your language to french
  2. Go to mobile users and try to change the password for an already existing user
  3. Note that you get an error
@vladimiroff
Copy link
Contributor

The reason that caused this issue is quite fun. Most of the "real world" languages use some funny symbols. Romanian guys put strange things on top of their characters, some nations decided to go right to left, the nation I'm from decided that latin symbols are overrated so they introduced their own and so on.

But what is the special thing in the french is the question is here? How comes that this issue is available only when using french? Well, they use apostrophes. "User data" in french is "Données d'utilisateur". And this translation is put into:

customDataEditor = uiElement.map_list('{{ couch_user.user_id }}', '{% trans 'User Data' %}');

There are single quotes around the translation of "User Data". So the apostrophe in "Données d'utilisateur" creates syntax error in the javascript. Since the js on the page is now broken, the form is being sent directly by the browser instead of as an asynchronous call (that expected json).

So it's up to you to decide how to fix the issue:

  1. Easy way: Just put double quotes there. This particular issue is solved.
  2. We could assume that this is not the only place where these apostrophes make things works. How about fixing them all?

If it's up to me, I would go with plan number 2. But that's up to you to decide. Are you okay with the idea of completely forbidding single quotes around trans just because of the french?

P.S.: Almost forgot. @dimagiupdate, ping :)

@czue
Copy link
Member

czue commented Aug 21, 2014

wow, thanks for the investigation @vladimiroff! i think both 1 and 2 are good answers (1 now, 2 as a best practice moving forward). definitely accepting fixes for either :) @dimagiupdate

@millerdev
Copy link
Contributor

👍 great answer

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