Giter Site home page Giter Site logo

Comments (3)

vladimiroff avatar vladimiroff commented on June 25, 2024

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 :)

from commcare-hq.

czue avatar czue commented on June 25, 2024

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

from commcare-hq.

millerdev avatar millerdev commented on June 25, 2024

👍 great answer

from commcare-hq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.