User language preference and why is it hard to implement


(Gabriel Mazetto) #1

Continuing the discussion from Multiple languages on single Discourse site:

On the other topic, I ended up with the idea that having more than one language enabled was hard, because of the javascript part, can someone explain to me the difficulties to make it happen?

I’m asking because I’m comfortable with rails and how easy it is to enable there (you just code a way to determine which language should be displayed, for example, by querying the user preference on the database, or by using the browser language setting), and call I18n to change to that language.

While discourse is not a 100% rails app, and it’s more a Ember.JS (if you consider the interface alone), than I can conclude that it’s somehow “Ember’s fault”.


(Jeff Atwood) #2

Pretty sure this got implemented via a community PR quite a while ago – if you enable the appropriate checkbox in site settings, users can select whatever language they want for the client-side UI.

Only downside (as I recall) is that strings for every language are sent down to the client in that case?


(Kane York) #3

No, I don’t believe that is correct. They get the correct .lang.js file.