Files
aowow/setup/tools/filegen/locales.ss.php
Sarjuuk bf184e7555 Core/Setup
* rewritten to be able to dynamicly load it's components
   - CLISetup -> checks for UtilityScripts (config, setup, dbc reader, etc.) -> checks for SetupScripts (individual sql/file generators)
   - each step may now have a help prompt attached. If none are provided, the containing script may provide it's help.
   - all Scripts are self contained modules. No more editing of 3+ files if some component is added/removed
 * removed intermediaries FileGen & SqlGen
 * functional changes
   - allow providing CLI arguments to siteconfig and account UtilityScript and skip the interactive prompts
   - set slot for consumable enchantment items so they are filtrable
   - zones dataset is now localized and generated from GlobalStrings.lua and DungeonMap.dbc. Related data dumps removed.
   - 'aowow' and 'prQueue' executables now have shebangs

    WARNING - command line options have been renamed!
2024-06-20 18:10:12 +02:00

75 lines
3.0 KiB
PHP

<?php
if (!defined('AOWOW_REVISION'))
die('illegal access');
if (!CLI)
die('not in cli mode');
// Create 'locale.js'-file in static/js
// available locales have to be set in aowow.aowow_config
CLISetup::registerSetup("build", new class extends SetupScript
{
use TrTemplateFile;
protected $info = array(
'locales' => [[], CLISetup::ARGV_PARAM, 'Compiles the Locale Object (static/js/locale.js) with available languages.']
);
protected $fileTemplateDest = ['static/js/locale.js'];
protected $fileTemplateSrc = ['locale.js.in'];
private function locales() : string
{
$available = array(
LOCALE_EN => " 0: { // English\r\n" .
" id: LOCALE_ENUS,\r\n" .
" name: 'enus',\r\n" .
" domain: 'www',\r\n" .
" description: 'English'\r\n" .
" }",
LOCALE_FR => " 2: { // French\r\n" .
" id: LOCALE_FRFR,\r\n" .
" name: 'frfr',\r\n" .
" domain: 'fr',\r\n" .
" description: 'Fran' + String.fromCharCode(231) + 'ais'\r\n" .
" }",
LOCALE_DE => " 3: { // German\r\n" .
" id: LOCALE_DEDE,\r\n" .
" name: 'dede',\r\n" .
" domain: 'de',\r\n" .
" description: 'Deutsch'\r\n" .
" }",
LOCALE_CN => " 4:{ // Chinese\r\n" .
" id: LOCALE_ZHCN,\r\n" .
" name: 'zhcn',\r\n" .
" domain: 'cn',\r\n" .
" description: String.fromCharCode(31616, 20307, 20013, 25991)\r\n" .
" }",
LOCALE_ES => " 6: { // Spanish\r\n" .
" id: LOCALE_ESES,\r\n" .
" name: 'eses',\r\n" .
" domain: 'es',\r\n" .
" description: 'Espa' + String.fromCharCode(241) + 'ol'\r\n" .
" }",
LOCALE_RU => " 8: { // Russian\r\n" .
" id: LOCALE_RURU,\r\n" .
" name: 'ruru',\r\n" .
" domain: 'ru',\r\n" .
" description: String.fromCharCode(1056, 1091, 1089, 1089, 1082, 1080, 1081)\r\n" .
" }",
);
$result = [];
foreach (CLISetup::$localeIds as $l)
if (isset($available[$l]))
$result[] = $available[$l];
return implode(",\r\n", $result);
}
});
?>