Open elgg-gitbot opened 11 years ago
trac user coldtrick wrote on 2012-02-29
Also a fix in the reload_all_translation function is needed to prevent a duplicate init.
elgg.reload_all_translations = function(language) {
var lang = language || elgg.get_language();
var url, options;
if (elgg.config.simplecache_enabled) {
url = 'cache/js/default/languages/' + lang + '.' + elgg.config.lastcache + '.js';
options = {};
} else {
url = 'ajax/view/js/languages';
options = {data: {language: lang}};
}
options['success'] = function(json) {
elgg.add_translation(lang, json);
if(elgg.config.languageReady !== true){
elgg.config.languageReady = true;
elgg.initWhenReady();
}
};
elgg.getJSON(url, options);
};
trac user coldtrick wrote on 2012-02-29
Better to pull the initWhenReady out of the reload function...
ewinslow wrote on 2012-05-03
requirejs would make all of this so much easier...
Milestone changed to Near Term Future Release
by ewinslow on 2012-05-03
Original ticket http://trac.elgg.org/ticket/4390 on 2012-02-29 by trac user coldtrick, assigned to unknown.
Elgg version: 1.8.3
Only the current user language is js loaded in js/lib/languages. Also the elgg.elgg_echo is not falling back to site language when user language key is not found.
This situation is very irritating when you are using a lot of elgg_echo's in js and have your site in a different language than "en"
I provide a quick fix here, but maybe cash can consider this in his translations caching system.
------- THE FIX -------
and