Has anyone been down the i18n Internationalization path and come up with an optimal solution (or any recommendations) for use in client side templates?
I'm using hogan templates with backbone and was planning on using lambdas. eg.
http://stackoverflow.com/questions/9211217/how-is-internationalization-configured-for-hogan-js/9263601however I didn't realise (until now) that lambdas don't work with pre-compiled templates. Someone has forked the official hogan repo to make this happen but it's an older version and doesn't look like it's being kept up to date:
https://github.com/twitter/hogan.js/issues/75So as far as I can see my options are:
a. serve up a different socketstream client package based on url or locale. Don't like this approach as it would require duplicating templates and we don't want to create language specific urls.
b. use the same socketstream package but duplicate templates and put in sepererate dirs. eg. templates-en, templates-jp, etc. then when setting the template I can prefix the appropriate dirname based on users current language. don't really like this approach either as i'm still duplicating templates which is going to make updates painful, not to mention the overhead of downloading multiple templates (or setting up lazy loading of language-based templates)
c. pass in the language strings with the model/dynamic data when calling the template render function (template then just contains a whole bunch of mustache tags).
d. try merge the changes in the forked version of hogan into the latest official version but then have to maintain the repo myself.
I don't need to implement Internationalization immediately. just planning for the future (~6 months) so if anyone knows of any solutions currently in development then i'd be keen to check them out.