aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/lib/languages.js26
1 files changed, 16 insertions, 10 deletions
diff --git a/js/lib/languages.js b/js/lib/languages.js
index ae7ba63e2..bfa858364 100644
--- a/js/lib/languages.js
+++ b/js/lib/languages.js
@@ -26,16 +26,22 @@ elgg.add_translation = function(lang, translations) {
elgg.reload_all_translations = function(language) {
var lang = language || elgg.get_language();
- elgg.getJSON('ajax/view/js/languages', {
- data: {
- language: lang
- },
- success: function(json) {
- elgg.add_translation(lang, json);
- elgg.config.languageReady = true;
- elgg.initWhenReady();
- }
- });
+ 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);
+ elgg.config.languageReady = true;
+ elgg.initWhenReady();
+ };
+
+ elgg.getJSON(url, options);
};
/**