Locales/Domain

* entirely switch over to write 'en' for locale 0 and accept both 'www' and 'en' for locale 0 when receiving
This commit is contained in:
Sarjuuk
2024-08-30 15:37:13 +02:00
parent e3fc4ebd62
commit a62f24b97c
8 changed files with 20 additions and 21 deletions

View File

@@ -969,23 +969,20 @@ abstract class Util
return Lang::item('ratingString', [$statId, $result, $level]);
}
public static function powerUseLocale($domain = 'www')
public static function powerUseLocale(string $domain = 'en') : void
{
foreach (Util::$localeStrings as $k => $v)
foreach (Util::$subDomains as $k => $v)
{
if (strstr($v, $domain))
{
User::useLocale($k);
Lang::load($k);
return;
}
if ($domain != $v)
continue;
User::useLocale($k);
Lang::load($k);
return;
}
if ($domain == 'www')
{
User::useLocale(LOCALE_EN);
Lang::load(LOCALE_EN);
}
User::useLocale(LOCALE_EN);
Lang::load(LOCALE_EN);
}
// default ucFirst doesn't convert UTF-8 chars

File diff suppressed because one or more lines are too long

View File

@@ -27,7 +27,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
LOCALE_EN => " 0: { // English\r\n" .
" id: LOCALE_ENUS,\r\n" .
" name: 'enus',\r\n" .
" domain: 'www',\r\n" .
" domain: 'en',\r\n" .
" description: 'English'\r\n" .
" }",
LOCALE_FR => " 2: { // French\r\n" .

View File

@@ -28,8 +28,8 @@ MarkupSourceMap[MARKUP_SOURCE_PTR] = 'ptr';
MarkupSourceMap[MARKUP_SOURCE_BETA] = 'beta';
var MarkupDomainRegexMap = {
betaPtrLang: /^(www|fr|de|cn|es|ru)$/, // Aowow - /^(beta|legion|wod|mop|ptr|www|ko|fr|de|cn|es|ru|pt|it)$/
lang: /^(www|fr|de|cn|es|ru)$/ // Aowow - /^(www|ko|fr|de|cn|es|ru|pt|it)$/
betaPtrLang: /^(www|en|fr|de|cn|es|ru)$/, // Aowow - /^(beta|legion|wod|mop|ptr|www|ko|fr|de|cn|es|ru|pt|it)$/
lang: /^(www|en|fr|de|cn|es|ru)$/ // Aowow - /^(www|ko|fr|de|cn|es|ru|pt|it)$/
};
var Markup = {
@@ -70,6 +70,7 @@ var Markup = {
nameCol: 'name_enus',
domainToLocale: {
'www': 'enus',
'en': 'enus',
// 'ptr': 'ptr',
// 'beta': 'beta',
// 'mop': 'beta',

View File

@@ -345,7 +345,7 @@ if (typeof $WowheadPower == "undefined") {
if (url) {
var
locale,
domain = "www";
domain = "en";
currentA = t;
if (params.domain) {

View File

@@ -0,0 +1 @@
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' tooltips markup locales');

View File

@@ -928,7 +928,7 @@ $WH.g_getLocaleFromDomain.L = {
cn: 4,
es: 6,
ru: 8,
www: 0
en: 0
};
$WH.g_getDomainFromLocale = function(locale) {
@@ -941,7 +941,7 @@ $WH.g_getDomainFromLocale = function(locale) {
lookup = $WH.g_getDomainFromLocale.L = $WH.g_createReverseLookupJson($WH.g_getLocaleFromDomain.L);
}
return (lookup[locale] ? lookup[locale] : 'www');
return (lookup[locale] ? lookup[locale] : 'en');
}
$WH.g_getIdFromTypeName = function (typeName) {

View File

@@ -13973,7 +13973,7 @@ Listview.templates = {
/** Variables **/
var container = $('<div></div>');
var hidden = (comment.__minPatch && g_getPatchVersion.T[comment.__minPatch] > new Date(comment.date));
comment.locale = (this.id == 'english-comments' ? 'www' : '');
comment.locale = (this.id == 'english-comments' ? 'en' : '');
/** Initialization.. Create base HTML skeleton */
container.append('<table><tr><td class="vote-column">' +