|
|
@ -23,7 +23,8 @@ $('.modal').on('show.bs.modal', function(){ |
|
|
|
$('.bs-switch').bootstrapSwitch(); |
|
|
|
$('.bs-switch').bootstrapSwitch(); |
|
|
|
|
|
|
|
|
|
|
|
// Strings we need translated
|
|
|
|
// Strings we need translated
|
|
|
|
var locale = {}; |
|
|
|
var locale = {}, |
|
|
|
|
|
|
|
def_locale = {}; |
|
|
|
|
|
|
|
|
|
|
|
// When pagination is done, how many item per page
|
|
|
|
// When pagination is done, how many item per page
|
|
|
|
var itemPerPage = 20; |
|
|
|
var itemPerPage = 20; |
|
|
@ -41,6 +42,18 @@ $.ajax({ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If current locale isn't EN, retrieve EN locale as a fallback
|
|
|
|
|
|
|
|
if (currentLang !== 'en'){ |
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
|
|
url: rootUrl + 'localize/en', |
|
|
|
|
|
|
|
type: 'GET', |
|
|
|
|
|
|
|
dataType: 'json', |
|
|
|
|
|
|
|
success: function(data) { |
|
|
|
|
|
|
|
def_locale = data; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Default ajax setup
|
|
|
|
// Default ajax setup
|
|
|
|
$.ajaxSetup({ |
|
|
|
$.ajaxSetup({ |
|
|
|
url: rootUrl + 'api', |
|
|
|
url: rootUrl + 'api', |
|
|
@ -56,6 +69,9 @@ function localize(string){ |
|
|
|
if (locale[string]){ |
|
|
|
if (locale[string]){ |
|
|
|
return locale[string]; |
|
|
|
return locale[string]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (def_locale[string]){ |
|
|
|
|
|
|
|
return def_locale[string]; |
|
|
|
|
|
|
|
} |
|
|
|
return string; |
|
|
|
return string; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|