Bug 1651032: Sort replacements per language and per script to ensure the generated file has stable contents. r=jwalden

Differential Revision: https://phabricator.services.mozilla.com/D82513
This commit is contained in:
André Bargull 2020-07-08 08:16:39 +00:00
Родитель c137a1324d
Коммит 9a4f210006
2 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -447,8 +447,8 @@ void js::intl::LanguageTag::performComplexRegionMappings() {
}
else if (language().equalTo("kaa") ||
language().equalTo("sog") ||
(language().equalTo("und") && script().equalTo("Sogd")) ||
(language().equalTo("und") && script().equalTo("Chrs")) ||
(language().equalTo("und") && script().equalTo("Sogd")) ||
(language().equalTo("und") && script().equalTo("Sogo")) ||
language().equalTo("uz") ||
language().equalTo("xco")) {
@ -483,9 +483,9 @@ void js::intl::LanguageTag::performComplexRegionMappings() {
(language().equalTo("ku") && script().equalTo("Arab")) ||
language().equalTo("mis") ||
language().equalTo("syr") ||
(language().equalTo("und") && script().equalTo("Xsux")) ||
(language().equalTo("und") && script().equalTo("Hatr")) ||
(language().equalTo("und") && script().equalTo("Syrc"))) {
(language().equalTo("und") && script().equalTo("Syrc")) ||
(language().equalTo("und") && script().equalTo("Xsux"))) {
setRegion("IQ");
}
else {
@ -566,8 +566,8 @@ void js::intl::LanguageTag::performComplexRegionMappings() {
}
else if (language().equalTo("kaa") ||
language().equalTo("sog") ||
(language().equalTo("und") && script().equalTo("Sogd")) ||
(language().equalTo("und") && script().equalTo("Chrs")) ||
(language().equalTo("und") && script().equalTo("Sogd")) ||
(language().equalTo("und") && script().equalTo("Sogo")) ||
language().equalTo("uz") ||
language().equalTo("xco")) {

Просмотреть файл

@ -319,12 +319,11 @@ void js::intl::LanguageTag::performComplexRegionMappings() {
first_case = True
for replacement_region in replacement_regions:
replacement_language_script = sorted(((language, script)
for (language, script, region) in (
non_default_replacements
)
if region == replacement_region),
key=itemgetter(0))
replacement_language_script = sorted((language, script)
for (language, script, region) in (
non_default_replacements
)
if region == replacement_region)
if_kind = u"if" if first_case else u"else if"
first_case = False