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) {
domReady.withResources(function () {
domReady.withResources(
loadi18n(function () {
$.ajax({
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
dataType: 'json',
@ -140,8 +141,9 @@
}
})
})
})
})
);
});
}
})

View File

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

View File

@ -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 );
}