diff --git a/includes/LanguageData.php b/includes/LanguageData.php index 8a7354b15..60c9b1280 100644 --- a/includes/LanguageData.php +++ b/includes/LanguageData.php @@ -71,10 +71,12 @@ class LanguageData { // ApiQuerySiteinfo $data['localTimezone'] = $config->get( 'Localtimezone' ); - $data['specialContributionsName'] = $this->specialPageFactory - ->getLocalNameFor( 'Contributions' ); - $data['specialNewSectionName'] = $this->specialPageFactory - ->getLocalNameFor( 'NewSection' ); + // special page names compared against Title::getText, which contains space + // But aliases are stored with underscores (db key) in the alias files + $data['specialContributionsName'] = str_replace( '_', ' ', $this->specialPageFactory + ->getLocalNameFor( 'Contributions' ) ); + $data['specialNewSectionName'] = str_replace( '_', ' ', $this->specialPageFactory + ->getLocalNameFor( 'NewSection' ) ); $localTimezone = $config->get( 'Localtimezone' ); // Return all timezone abbreviations for the local timezone (there will often be two, for diff --git a/tests/cases/comments.json b/tests/cases/comments.json index cd4dc5265..98424a6ff 100644 --- a/tests/cases/comments.json +++ b/tests/cases/comments.json @@ -230,5 +230,13 @@ "expected": "../cases/timestamp-format-switch/timestamp-format-switch.json", "config": "../data/enwiki-config.json", "data": "../data/enwiki-data.json" + }, + { + "name": "Signatures with Special:Contributions (alias with underscored)", + "title": "Talk:Signatures Alias", + "dom": "cases/signatures-comments/signatures-contribs-alias-underscore.html", + "expected": "../cases/signatures-comments/signatures-contribs-alias-underscore.json", + "config": "../data/huwiki-config.json", + "data": "../data/huwiki-data.json" } ] diff --git a/tests/cases/datatest-ckb.json b/tests/cases/datatest-ckb.json index 753344a92..1b9332e94 100644 --- a/tests/cases/datatest-ckb.json +++ b/tests/cases/datatest-ckb.json @@ -17,7 +17,7 @@ ] }, "localTimezone": "UTC", - "specialContributionsName": "Contributions", + "specialContributionsName": "بەشدارییەکان", "specialNewSectionName": "NewSection", "timezones": { "ckb": { diff --git a/tests/cases/datatest-hu.json b/tests/cases/datatest-hu.json new file mode 100644 index 000000000..fd56b68c6 --- /dev/null +++ b/tests/cases/datatest-hu.json @@ -0,0 +1,81 @@ +{ + "dateFormat": { + "hu": "Y. F j., H:i" + }, + "digits": { + "hu": [ + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9" + ] + }, + "localTimezone": "UTC", + "specialContributionsName": "Szerkesztő közreműködései", + "specialNewSectionName": "NewSection", + "timezones": { + "hu": { + "UTC": "UTC" + } + }, + "contLangMessages": { + "hu": { + "sunday": "vasárnap", + "monday": "hétfő", + "tuesday": "kedd", + "wednesday": "szerda", + "thursday": "csütörtök", + "friday": "péntek", + "saturday": "szombat", + "sun": "vas", + "mon": "hét", + "tue": "kedd", + "wed": "sze", + "thu": "csü", + "fri": "pén", + "sat": "szo", + "january": "január", + "february": "február", + "march": "március", + "april": "április", + "may_long": "május", + "june": "június", + "july": "július", + "august": "augusztus", + "september": "szeptember", + "october": "október", + "november": "november", + "december": "december", + "january-gen": "január", + "february-gen": "február", + "march-gen": "március", + "april-gen": "április", + "may-gen": "május", + "june-gen": "június", + "july-gen": "július", + "august-gen": "augusztus", + "september-gen": "szeptember", + "october-gen": "október", + "november-gen": "november", + "december-gen": "december", + "jan": "jan", + "feb": "febr", + "mar": "márc", + "apr": "ápr", + "may": "máj", + "jun": "jún", + "jul": "júl", + "aug": "aug", + "sep": "szept", + "oct": "okt", + "nov": "nov", + "dec": "dec" + } + } +} diff --git a/tests/cases/datatest-sr.json b/tests/cases/datatest-sr.json index db993c5cc..fc89efd31 100644 --- a/tests/cases/datatest-sr.json +++ b/tests/cases/datatest-sr.json @@ -43,8 +43,8 @@ ] }, "localTimezone": "UTC", - "specialContributionsName": "Contributions", - "specialNewSectionName": "NewSection", + "specialContributionsName": "Доприноси", + "specialNewSectionName": "Нови одељак", "timezones": { "sr": { "UTC": "UTC" diff --git a/tests/cases/datatest-th.json b/tests/cases/datatest-th.json index 0612f691a..89f7e869e 100644 --- a/tests/cases/datatest-th.json +++ b/tests/cases/datatest-th.json @@ -17,7 +17,7 @@ ] }, "localTimezone": "Asia/Bangkok", - "specialContributionsName": "Contributions", + "specialContributionsName": "เรื่องที่เขียน", "specialNewSectionName": "NewSection", "timezones": { "th": { diff --git a/tests/cases/signatures-comments/signatures-contribs-alias-underscore.html b/tests/cases/signatures-comments/signatures-contribs-alias-underscore.html new file mode 100644 index 000000000..f981be40e --- /dev/null +++ b/tests/cases/signatures-comments/signatures-contribs-alias-underscore.html @@ -0,0 +1,4 @@ +
Hello 127.0.0.1 2023. január 13., 10:25 (CET) +
+