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,23 +969,20 @@ abstract class Util
|
|||||||
return Lang::item('ratingString', [$statId, $result, $level]);
|
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))
|
if ($domain != $v)
|
||||||
{
|
continue;
|
||||||
User::useLocale($k);
|
|
||||||
Lang::load($k);
|
User::useLocale($k);
|
||||||
return;
|
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
|
// default ucFirst doesn't convert UTF-8 chars
|
||||||
|
|||||||
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" .
|
LOCALE_EN => " 0: { // English\r\n" .
|
||||||
" id: LOCALE_ENUS,\r\n" .
|
" id: LOCALE_ENUS,\r\n" .
|
||||||
" name: 'enus',\r\n" .
|
" name: 'enus',\r\n" .
|
||||||
" domain: 'www',\r\n" .
|
" domain: 'en',\r\n" .
|
||||||
" description: 'English'\r\n" .
|
" description: 'English'\r\n" .
|
||||||
" }",
|
" }",
|
||||||
LOCALE_FR => " 2: { // French\r\n" .
|
LOCALE_FR => " 2: { // French\r\n" .
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ MarkupSourceMap[MARKUP_SOURCE_PTR] = 'ptr';
|
|||||||
MarkupSourceMap[MARKUP_SOURCE_BETA] = 'beta';
|
MarkupSourceMap[MARKUP_SOURCE_BETA] = 'beta';
|
||||||
|
|
||||||
var MarkupDomainRegexMap = {
|
var MarkupDomainRegexMap = {
|
||||||
betaPtrLang: /^(www|fr|de|cn|es|ru)$/, // Aowow - /^(beta|legion|wod|mop|ptr|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|fr|de|cn|es|ru)$/ // Aowow - /^(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 = {
|
var Markup = {
|
||||||
@@ -70,6 +70,7 @@ var Markup = {
|
|||||||
nameCol: 'name_enus',
|
nameCol: 'name_enus',
|
||||||
domainToLocale: {
|
domainToLocale: {
|
||||||
'www': 'enus',
|
'www': 'enus',
|
||||||
|
'en': 'enus',
|
||||||
// 'ptr': 'ptr',
|
// 'ptr': 'ptr',
|
||||||
// 'beta': 'beta',
|
// 'beta': 'beta',
|
||||||
// 'mop': 'beta',
|
// 'mop': 'beta',
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ if (typeof $WowheadPower == "undefined") {
|
|||||||
if (url) {
|
if (url) {
|
||||||
var
|
var
|
||||||
locale,
|
locale,
|
||||||
domain = "www";
|
domain = "en";
|
||||||
|
|
||||||
currentA = t;
|
currentA = t;
|
||||||
if (params.domain) {
|
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,
|
cn: 4,
|
||||||
es: 6,
|
es: 6,
|
||||||
ru: 8,
|
ru: 8,
|
||||||
www: 0
|
en: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
$WH.g_getDomainFromLocale = function(locale) {
|
$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);
|
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) {
|
$WH.g_getIdFromTypeName = function (typeName) {
|
||||||
|
|||||||
@@ -13973,7 +13973,7 @@ Listview.templates = {
|
|||||||
/** Variables **/
|
/** Variables **/
|
||||||
var container = $('<div></div>');
|
var container = $('<div></div>');
|
||||||
var hidden = (comment.__minPatch && g_getPatchVersion.T[comment.__minPatch] > new Date(comment.date));
|
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 */
|
/** Initialization.. Create base HTML skeleton */
|
||||||
container.append('<table><tr><td class="vote-column">' +
|
container.append('<table><tr><td class="vote-column">' +
|
||||||
|
|||||||
Reference in New Issue
Block a user