mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
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:
@@ -969,24 +969,21 @@ 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)
|
||||
{
|
||||
if (strstr($v, $domain))
|
||||
foreach (Util::$subDomains as $k => $v)
|
||||
{
|
||||
if ($domain != $v)
|
||||
continue;
|
||||
|
||||
User::useLocale($k);
|
||||
Lang::load($k);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ($domain == 'www')
|
||||
{
|
||||
User::useLocale(LOCALE_EN);
|
||||
Lang::load(LOCALE_EN);
|
||||
}
|
||||
}
|
||||
|
||||
// default ucFirst doesn't convert UTF-8 chars
|
||||
public static function ucFirst($str)
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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" .
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -345,7 +345,7 @@ if (typeof $WowheadPower == "undefined") {
|
||||
if (url) {
|
||||
var
|
||||
locale,
|
||||
domain = "www";
|
||||
domain = "en";
|
||||
|
||||
currentA = t;
|
||||
if (params.domain) {
|
||||
|
||||
1
setup/updates/1725025019_01.sql
Normal file
1
setup/updates/1725025019_01.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE `aowow_dbversion` SET `build` = CONCAT(IFNULL(`build`, ''), ' tooltips markup locales');
|
||||
@@ -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) {
|
||||
|
||||
@@ -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">' +
|
||||
|
||||
Reference in New Issue
Block a user