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
This commit is contained in:
Olivier Lamy 2012-04-02 11:37:22 +00:00
parent f2b03e81f1
commit 9071e5a4ca
3 changed files with 9 additions and 6 deletions

View File

@ -121,7 +121,8 @@
require(['order!domReady','order!jquery','order!i18n','order!startup'], function (domReady) { require(['order!domReady','order!jquery','order!i18n','order!startup'], function (domReady) {
domReady.withResources(function () { domReady.withResources(
loadi18n(function () {
$.ajax({ $.ajax({
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(), url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
dataType: 'json', dataType: 'json',
@ -142,6 +143,7 @@
} }
}) })
}) })
);
}); });
} }
}) })

View File

@ -30,5 +30,5 @@ function() {
cache: false,//!window.archivaDevMode cache: false,//!window.archivaDevMode
dataType: 'json' dataType: 'json'
}); });
loadi18n();
}); });

View File

@ -19,14 +19,15 @@
define("utils",["jquery","i18n","jquery.tmpl"], function() { define("utils",["jquery","i18n","jquery.tmpl"], function() {
loadi18n=function(){ loadi18n=function(loadCallback){
var browserLang = usedLang(); var browserLang = usedLang();
$.log("use browserLang:"+browserLang); $.log("use browserLang:"+browserLang);
var options = { var options = {
cache:false, cache:false,
mode: 'map', mode: 'map',
encoding:'utf-8' encoding:'utf-8',
callback: loadCallback
}; };
loadAndParseFile("restServices/archivaServices/commonServices/getAllI18nResources?locale="+browserLang,options ); loadAndParseFile("restServices/archivaServices/commonServices/getAllI18nResources?locale="+browserLang,options );
} }