mirror of https://github.com/apache/archiva.git
make i18n more AMD compliant
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1359581 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
94489731e3
commit
d3731db036
|
@ -151,7 +151,7 @@
|
|||
|
||||
|
||||
|
||||
require(['jquery','i18n','sammy','startup','domReady!'], function (domReady) {
|
||||
require(['jquery','i18n','sammy','startup','utils','domReady!'], function (domReady) {
|
||||
loadi18n(function () {
|
||||
$.ajax({
|
||||
url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
define("utils",["jquery","i18n","jquery.tmpl"], function() {
|
||||
|
||||
loadi18n=function(loadCallback){
|
||||
$.log("loadi18n");
|
||||
var browserLang = usedLang();
|
||||
$.log("use browserLang:"+browserLang);
|
||||
|
||||
|
|
|
@ -12,6 +12,18 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
(function($, window) {
|
||||
(function(factory){
|
||||
// Support module loading scenarios
|
||||
if (typeof define === 'function' && define.amd){
|
||||
// AMD Anonymous Module
|
||||
define(['jquery'], factory);
|
||||
} else {
|
||||
// No module loader (plain <script> tag) - put directly in global namespace
|
||||
$.sammy = window.Sammy = factory($);
|
||||
}
|
||||
})
|
||||
|
||||
(function($) {
|
||||
$.i18n = {};
|
||||
|
||||
|
@ -478,5 +490,6 @@ String.prototype.split = function (separator, limit) {
|
|||
return cbSplit(this, separator, limit);
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
});
|
||||
|
||||
})(jQuery, window);
|
Loading…
Reference in New Issue