From: Olivier Lamy Date: Mon, 2 Apr 2012 11:37:22 +0000 (+0000) Subject: really ensure we load i18n before loading ui X-Git-Tag: archiva-1.4-M3~871 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9071e5a4cab6611197d0769ed183b59c5840d812;p=archiva.git really ensure we load i18n before loading ui git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308308 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html index 35faced7a..e460e13c2 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html @@ -121,7 +121,8 @@ require(['order!domReady','order!jquery','order!i18n','order!startup'], function (domReady) { - domReady.withResources(function () { + domReady.withResources( + loadi18n(function () { $.ajax({ url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(), dataType: 'json', @@ -140,8 +141,9 @@ } - }) - }) + }) + }) + ); }); } }) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js index 481d0df44..46c8ee412 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js @@ -30,5 +30,5 @@ function() { cache: false,//!window.archivaDevMode dataType: 'json' }); - loadi18n(); + }); \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 5ab9e81ab..5f50407a5 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -19,14 +19,15 @@ define("utils",["jquery","i18n","jquery.tmpl"], function() { - loadi18n=function(){ + loadi18n=function(loadCallback){ var browserLang = usedLang(); $.log("use browserLang:"+browserLang); var options = { cache:false, mode: 'map', - encoding:'utf-8' + encoding:'utf-8', + callback: loadCallback }; loadAndParseFile("restServices/archivaServices/commonServices/getAllI18nResources?locale="+browserLang,options ); }