]> source.dussan.org Git - archiva.git/commitdiff
really ensure we load i18n before loading ui
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 11:37:22 +0000 (11:37 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Apr 2012 11:37:22 +0000 (11:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1308308 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/startup.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js

index 35faced7a520e18337e526af9c2f4db753ba87bf..e460e13c2eb0335a26f523c876390feb86067695 100644 (file)
 
 
                 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',
 
 
                           }
-                      })
-                  })
+                        })
+                    })
+                  );
                 });
         }
     })
index 481d0df4400715995611fca3c606f2c77c19480e..46c8ee4127480a061c0c4491ca26fcdef33699af 100644 (file)
@@ -30,5 +30,5 @@ function() {
     cache: false,//!window.archivaDevMode
     dataType: 'json'
   });
-  loadi18n();
+
 });
\ No newline at end of file
index 5ab9e81abce2f0594193fe4324560f2bf208bf7c..5f50407a5dfd7e9d0a3d32936e4d39ba8f103f0f 100644 (file)
 
 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 );
   }