Files
aowow/setup/tools/filegen/templates/locale.js.in
Sarjuuk feaee59cd0 - converted articles for MorePages to use STATIC_URL (also neutralized some self-references)
- added config-option to restrict available locales
- fixed opensearch suggestions by generating strict json
- include TalentCalc.css as lowerCase (fixes display under *nix)
- some minor formating
- Setup:
 * added some additional files to be generated (they required STATIC_URL or HOST_URL to be set)
 * moved class Locale from global.js to own template and generate it with CFG_LOCALES
 * changed urlParam (?build=script): may be empty (builds everything) or specific scriptNames chained together with ; (?build=script1;script2)

you are required to run the following command to regenerate files affected by these cahnges
?build=demo;power;realmMenu;searchboxBody;searchboxScript;searchplugin;locales
2014-09-13 23:26:01 +02:00

63 lines
1.0 KiB
JavaScript

/*
Locale class
*/
var LOCALE_ENUS = 0;
var LOCALE_FRFR = 2;
var LOCALE_DEDE = 3;
var LOCALE_ESES = 6;
var LOCALE_RURU = 8;
var Locale = {
current: {},
// All
locales: {
/*setup:locales*/
},
getAll: function() {
var result = [];
for (var id in Locale.locales) {
result.push(Locale.locales[id]);
}
return result;
},
getAllByName: function() {
var result = Locale.getAll();
result.sort(function(a, b) {
return $WH.strcmp(a.description, b.description);
});
return result;
},
getId: function() {
return Locale.current.id;
},
getName: function() {
var localeId = Locale.getId();
return Locale.locales[localeId].name;
},
get: function() {
var localeId = Locale.getId();
return Locale.locales[localeId];
},
set: function(localeId) {
$.extend(Locale.current, Locale.locales[localeId]);
}
};
Locale.set(LOCALE_ENUS); // Default