Files
aowow/setup/tools/filegen/templates/global.js/locale.js
Sarjuuk 6557e70d5c Template/Update (Part 47)
* split global.js into its components, so it can be reasonably processed by setup
 * make reputation requirements configurable
 * move Markup and Locale back into global.js (removed associated build scripts)
 * extend Icon to display iconId in lightbox popup
2025-09-25 16:01:14 +02:00

70 lines
1.1 KiB
JavaScript

/*
Locale class
*/
var LOCALE_ENUS = 0;
var LOCALE_FRFR = 2;
var LOCALE_DEDE = 3;
var LOCALE_ZHCN = 4;
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