miguelfreitas/twister-html — pull request #29 by msjoinder (2014-01-13 01:06:41+00:00)
Title: Set up translation library Polyglot.js

Uses JavaScript to detect user's language
Uses Polyglot.js ( https://github.com/airbnb/polyglot.js ) to match to translate Twister UI

* Using Polyglot on the JS side is easy - use polyglot.t("text") in place of a string, and if "text" is one of the words in the dictionary, it will translate the word.
* A list of words and explanation to add more languages is in interface_localization.js
* Using Polyglot with the HTML templates was more complicated. In interface_localization.js, there is a list of selectors for elements that need to be translated, such as ".network h2, .network h3" for the titles on the Network page. Once jQuery(document).ready is called, the templates are translated in time for the updated elements to be used.
* Right now only English is available so translation is not visible, but if you uncomment 172-174 in interface_localization.js it will replace all strings with filler text. If anything is left untranslated then it should be fixed in JS or the element should be added to the list in interface_localization.js