iJs is one of the many implementations of the GNU Gettext. Here I will show how to integrate it to simple ExtJs application. You can use another implementation of the i18n, the only suggestion I can give you is to use the same service for backend and frontend to avoid problems in the future (DRY).
The initialization of the i18n is produced before the launch of the RIA.
launch: function () { this.loadInternazialization(); this.setMainView('app.view.Main'); }, loadInternazialization: function() { igt = new iJS.Gettext(); igt.setlocale("de_DE.utf8"); igt.bindtextdomain("Simpsons", "translation", "po"); igt.try_load_lang(); }
As a language catalogue I have used ‘.po’ format. It is loaded synchronously from the server. As a base language English is used which is translated into German.