Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2680788
D25695.1734624126.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
4 KB
Referenced Files
None
Subscribers
None
D25695.1734624126.diff
View Options
diff --git a/src/internationalization/locales/PhutilCzechLocale.php b/src/internationalization/locales/PhutilCzechLocale.php
--- a/src/internationalization/locales/PhutilCzechLocale.php
+++ b/src/internationalization/locales/PhutilCzechLocale.php
@@ -27,4 +27,8 @@
return $plural;
}
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilFrenchLocale.php b/src/internationalization/locales/PhutilFrenchLocale.php
--- a/src/internationalization/locales/PhutilFrenchLocale.php
+++ b/src/internationalization/locales/PhutilFrenchLocale.php
@@ -13,4 +13,9 @@
return pht('French (France)');
}
+
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilGermanLocale.php b/src/internationalization/locales/PhutilGermanLocale.php
--- a/src/internationalization/locales/PhutilGermanLocale.php
+++ b/src/internationalization/locales/PhutilGermanLocale.php
@@ -13,4 +13,8 @@
return pht('German (Germany)');
}
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilKoreanLocale.php b/src/internationalization/locales/PhutilKoreanLocale.php
--- a/src/internationalization/locales/PhutilKoreanLocale.php
+++ b/src/internationalization/locales/PhutilKoreanLocale.php
@@ -13,4 +13,8 @@
return pht('Korean (Republic of Korea)');
}
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilPortugueseBrazilLocale.php b/src/internationalization/locales/PhutilPortugueseBrazilLocale.php
--- a/src/internationalization/locales/PhutilPortugueseBrazilLocale.php
+++ b/src/internationalization/locales/PhutilPortugueseBrazilLocale.php
@@ -13,4 +13,11 @@
return pht('Portuguese (Brazil)');
}
+ public function getFallbackLocaleCode() {
+ // Phabricator does not support bidirectional fallbacks (pt_BR -> pt and pt -> pt_BR simultaneously)
+ // since Translatewiki calls this locale "Portugese" without a country it makes slightly more sense
+ // to fall back in this direction than the other one
+ return 'pt_PT';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilPortuguesePortugalLocale.php b/src/internationalization/locales/PhutilPortuguesePortugalLocale.php
--- a/src/internationalization/locales/PhutilPortuguesePortugalLocale.php
+++ b/src/internationalization/locales/PhutilPortuguesePortugalLocale.php
@@ -13,4 +13,13 @@
return pht('Portuguese (Portugal)');
}
+ public function getFallbackLocaleCode() {
+ // Ideally this would be pt_BR but Phabricator does not support bidirectional fallbacks
+ // (pt_BR -> pt and pt -> pt_BR simultaneously)
+ // since Translatewiki calls pt_PT "Portugese" without a country
+ // it makes slightly more sense to fall back in the other direction
+ // In the mean time return `en_US` so users don't see Proto-English unncecessarily
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilSimplifiedChineseLocale.php b/src/internationalization/locales/PhutilSimplifiedChineseLocale.php
--- a/src/internationalization/locales/PhutilSimplifiedChineseLocale.php
+++ b/src/internationalization/locales/PhutilSimplifiedChineseLocale.php
@@ -13,4 +13,12 @@
return pht('Chinese (Simplified)');
}
+ public function getFallbackLocaleCode() {
+ // Ideally this would be zh_Hant but Phabricator does not support bidirectional fallbacks
+ // (zh_Hant -> zh_Hans and zh_Hans -> zh_Hant simultaneously)
+ // arbitrarily choose to fall back in the other direction instead
+ // In the mean time return `en_US` so users don't see Proto-English unncecessarily
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilSpanishSpainLocale.php b/src/internationalization/locales/PhutilSpanishSpainLocale.php
--- a/src/internationalization/locales/PhutilSpanishSpainLocale.php
+++ b/src/internationalization/locales/PhutilSpanishSpainLocale.php
@@ -13,4 +13,8 @@
return pht('Spanish (Spain)');
}
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
}
diff --git a/src/internationalization/locales/PhutilTraditionalChineseLocale.php b/src/internationalization/locales/PhutilTraditionalChineseLocale.php
--- a/src/internationalization/locales/PhutilTraditionalChineseLocale.php
+++ b/src/internationalization/locales/PhutilTraditionalChineseLocale.php
@@ -13,4 +13,8 @@
return pht('Chinese (Traditional)');
}
+ public function getFallbackLocaleCode() {
+ return 'zh_Hans';
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 16:02 (18 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015153
Default Alt Text
D25695.1734624126.diff (4 KB)
Attached To
Mode
D25695: Add fallback languages for locale files
Attached
Detach File
Event Timeline
Log In to Comment