BoilerplateMVC / Marionette-Require-Boilerplate

Marionette-Require-Boilerplate
MIT License
242 stars 61 forks source link

Loading json i18n files #7

Closed lucaperret closed 10 years ago

lucaperret commented 11 years ago

Hello, The i18n language file is loaded two times (XHR log). Is it possible to define this json language file globally for all templates ? How can I change the localization language ?

brettjonesdev commented 11 years ago

Hmmm interesting. I will look into this when I get a chance. I believe how it works is if you are using non-pre-compiled templates, hbs will look for what i18n language the user's browser has, find the closest match, and pass that setting in to the templates. But when you do a build, you would need a separate build for each language you will actually support, adding a locale: 'en-us' to the hbs config object for each separate build. As far as how hbs would know which of these builds to use goes... that is unclear to me at this point. I will try to take some time this week to figure out how to make that work, though. Let me know if you do figure it out!

Here's the documentation: https://github.com/brettjonesdev/require-handlebars-plugin?source=c#i18n

lucaperret commented 11 years ago

Ok, this solution is not confortable. I see https://github.com/ggozad/underi18n and more plugins, but no one is able to make me happiness. I'm novice for requirejs implementation, but I will search a fix for my problem. Thanks for BMVC & your help!

brettjonesdev commented 11 years ago

No problem. I will try to find time to look into this, as I would like to know the right way of doing this myself. If you find any convenient way to accomplish this in conjunction with a build, let me know.

brettjonesdev commented 11 years ago

whoops didn't mean to close this.