From ace72189a7f56fbba898ee1ccb52fd7eba80ae2e Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sun, 10 Apr 2011 03:11:52 +0000 Subject: Refs #3182: Feeding language loading through /ajax/view to keep thing simpler for now. Reorganized boot process so that we can ajax load the languages asap git-svn-id: http://code.elgg.org/elgg/trunk@8976 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/elgglib.js | 2 +- js/lib/languages.js | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'js/lib') diff --git a/js/lib/elgglib.js b/js/lib/elgglib.js index 5ba80fc06..f2545fb6c 100644 --- a/js/lib/elgglib.js +++ b/js/lib/elgglib.js @@ -379,4 +379,4 @@ elgg.getSelectorFromUrlFragment = function(url) { } } return ''; -} \ No newline at end of file +}; \ No newline at end of file diff --git a/js/lib/languages.js b/js/lib/languages.js index 0e3cf4472..28b82e2e9 100644 --- a/js/lib/languages.js +++ b/js/lib/languages.js @@ -25,12 +25,8 @@ elgg.add_translation = function(lang, translations) { */ elgg.reload_all_translations = function(language) { var lang = language || elgg.get_language(); - // This...................vvvvv is a double encoded question mark (? -> %2f -> %252f) - elgg.getJSON('js/languages%252f' + lang + '.js', { - data: { - 'viewtype': 'default', - 'lastcache': elgg.config.lastcache - }, + + elgg.getJSON('ajax/view/js/languages/' + lang, { success: function(json) { elgg.add_translation(lang, json); } -- cgit v1.2.3 From 21ccb999e304af2fa54b7fb6009199eec218d1d1 Mon Sep 17 00:00:00 2001 From: ewinslow Date: Sun, 10 Apr 2011 03:37:47 +0000 Subject: Fixes #3182: No attempt to go through simplecache at all, but any language can be exported to js now without any extra effort on the part of language pack authors git-svn-id: http://code.elgg.org/elgg/trunk@8977 36083f99-b078-4883-b0ff-0f9b5a30f544 --- js/lib/languages.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'js/lib') diff --git a/js/lib/languages.js b/js/lib/languages.js index 28b82e2e9..4cfe84968 100644 --- a/js/lib/languages.js +++ b/js/lib/languages.js @@ -26,7 +26,10 @@ elgg.add_translation = function(lang, translations) { elgg.reload_all_translations = function(language) { var lang = language || elgg.get_language(); - elgg.getJSON('ajax/view/js/languages/' + lang, { + elgg.getJSON('ajax/view/js/languages', { + data: { + language: lang + }, success: function(json) { elgg.add_translation(lang, json); } -- cgit v1.2.3