Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13957039
D15979.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D15979.id.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -180,7 +180,9 @@
'PhutilEditorConfigTestCase' => 'parser/__tests__/PhutilEditorConfigTestCase.php',
'PhutilEmailAddress' => 'parser/PhutilEmailAddress.php',
'PhutilEmailAddressTestCase' => 'parser/__tests__/PhutilEmailAddressTestCase.php',
+ 'PhutilEmojiLocale' => 'internationalization/locales/PhutilEmojiLocale.php',
'PhutilEmptyAuthAdapter' => 'auth/PhutilEmptyAuthAdapter.php',
+ 'PhutilEnglishCanadaLocale' => 'internationalization/locales/PhutilEnglishCanadaLocale.php',
'PhutilErrorHandler' => 'error/PhutilErrorHandler.php',
'PhutilErrorHandlerTestCase' => 'error/__tests__/PhutilErrorHandlerTestCase.php',
'PhutilErrorTrap' => 'error/PhutilErrorTrap.php',
@@ -201,6 +203,8 @@
'PhutilFileLock' => 'filesystem/PhutilFileLock.php',
'PhutilFileLockTestCase' => 'filesystem/__tests__/PhutilFileLockTestCase.php',
'PhutilFileTree' => 'filesystem/PhutilFileTree.php',
+ 'PhutilFrenchLocale' => 'internationalization/locales/PhutilFrenchLocale.php',
+ 'PhutilGermanLocale' => 'internationalization/locales/PhutilGermanLocale.php',
'PhutilGitHubAuthAdapter' => 'auth/PhutilGitHubAuthAdapter.php',
'PhutilGitHubFuture' => 'future/github/PhutilGitHubFuture.php',
'PhutilGitHubResponse' => 'future/github/PhutilGitHubResponse.php',
@@ -290,6 +294,8 @@
'PhutilPhabricatorAuthAdapter' => 'auth/PhutilPhabricatorAuthAdapter.php',
'PhutilPhtTestCase' => 'internationalization/__tests__/PhutilPhtTestCase.php',
'PhutilPirateEnglishLocale' => 'internationalization/locales/PhutilPirateEnglishLocale.php',
+ 'PhutilPortugueseBrazilLocale' => 'internationalization/locales/PhutilPortugueseBrazilLocale.php',
+ 'PhutilPortuguesePortugalLocale' => 'internationalization/locales/PhutilPortuguesePortugalLocale.php',
'PhutilPregsprintfTestCase' => 'xsprintf/__tests__/PhutilPregsprintfTestCase.php',
'PhutilProcessGroupDaemon' => 'daemon/torture/PhutilProcessGroupDaemon.php',
'PhutilProtocolChannel' => 'channel/PhutilProtocolChannel.php',
@@ -350,6 +356,7 @@
'PhutilSimpleOptionsLexer' => 'lexer/PhutilSimpleOptionsLexer.php',
'PhutilSimpleOptionsLexerTestCase' => 'lexer/__tests__/PhutilSimpleOptionsLexerTestCase.php',
'PhutilSimpleOptionsTestCase' => 'parser/__tests__/PhutilSimpleOptionsTestCase.php',
+ 'PhutilSimplifiedChineseChinaLocale' => 'internationalization/locales/PhutilSimplifiedChineseChinaLocale.php',
'PhutilSocketChannel' => 'channel/PhutilSocketChannel.php',
'PhutilSortVector' => 'utils/PhutilSortVector.php',
'PhutilSpanishSpainLocale' => 'internationalization/locales/PhutilSpanishSpainLocale.php',
@@ -729,7 +736,9 @@
'PhutilEditorConfigTestCase' => 'PhutilTestCase',
'PhutilEmailAddress' => 'Phobject',
'PhutilEmailAddressTestCase' => 'PhutilTestCase',
+ 'PhutilEmojiLocale' => 'PhutilLocale',
'PhutilEmptyAuthAdapter' => 'PhutilAuthAdapter',
+ 'PhutilEnglishCanadaLocale' => 'PhutilLocale',
'PhutilErrorHandler' => 'Phobject',
'PhutilErrorHandlerTestCase' => 'PhutilTestCase',
'PhutilErrorTrap' => 'Phobject',
@@ -750,6 +759,8 @@
'PhutilFileLock' => 'PhutilLock',
'PhutilFileLockTestCase' => 'PhutilTestCase',
'PhutilFileTree' => 'Phobject',
+ 'PhutilFrenchLocale' => 'PhutilLocale',
+ 'PhutilGermanLocale' => 'PhutilLocale',
'PhutilGitHubAuthAdapter' => 'PhutilOAuthAuthAdapter',
'PhutilGitHubFuture' => 'FutureProxy',
'PhutilGitHubResponse' => 'Phobject',
@@ -844,6 +855,8 @@
'PhutilPhabricatorAuthAdapter' => 'PhutilOAuthAuthAdapter',
'PhutilPhtTestCase' => 'PhutilTestCase',
'PhutilPirateEnglishLocale' => 'PhutilLocale',
+ 'PhutilPortugueseBrazilLocale' => 'PhutilLocale',
+ 'PhutilPortuguesePortugalLocale' => 'PhutilLocale',
'PhutilPregsprintfTestCase' => 'PhutilTestCase',
'PhutilProcessGroupDaemon' => 'PhutilTortureTestDaemon',
'PhutilProtocolChannel' => 'PhutilChannelChannel',
@@ -905,6 +918,7 @@
'PhutilSimpleOptionsLexer' => 'PhutilLexer',
'PhutilSimpleOptionsLexerTestCase' => 'PhutilTestCase',
'PhutilSimpleOptionsTestCase' => 'PhutilTestCase',
+ 'PhutilSimplifiedChineseChinaLocale' => 'PhutilLocale',
'PhutilSocketChannel' => 'PhutilChannel',
'PhutilSortVector' => 'Phobject',
'PhutilSpanishSpainLocale' => 'PhutilLocale',
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
@@ -13,12 +13,6 @@
return pht('Czech (Czech Republic)');
}
- public function isTestLocale() {
- // This doesn't have any translations yet so mark it as a test locale
- // for now.
- return true;
- }
-
public function selectPluralVariant($variant, array $translations) {
list($singular, $paucal, $plural) = $translations;
diff --git a/src/internationalization/locales/PhutilEmojiLocale.php b/src/internationalization/locales/PhutilEmojiLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilEmojiLocale.php
@@ -0,0 +1,33 @@
+<?php
+
+/**
+ * A picture is worth a thousand words.
+ */
+final class PhutilEmojiLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'en_X*';
+ }
+
+ public function getLocaleName() {
+ return pht('Emoji (Internet)');
+ }
+
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
+ public function isSillyLocale() {
+ return true;
+ }
+
+ public function selectPluralVariant($variant, array $translations) {
+ // Emoji have a unique variant for every available value: 0, 1, 2, 3, ...
+ if (count($translations) <= $variant) {
+ return end($translations);
+ }
+
+ return $translations[$variant];
+ }
+
+}
diff --git a/src/internationalization/locales/PhutilEnglishCanadaLocale.php b/src/internationalization/locales/PhutilEnglishCanadaLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilEnglishCanadaLocale.php
@@ -0,0 +1,20 @@
+<?php
+
+/**
+ * Locale for "English (Canada)".
+ */
+final class PhutilEnglishCanadaLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'en_CA';
+ }
+
+ public function getLocaleName() {
+ return pht('English (Canada)');
+ }
+
+ public function getFallbackLocaleCode() {
+ return 'en_US';
+ }
+
+}
diff --git a/src/internationalization/locales/PhutilFrenchLocale.php b/src/internationalization/locales/PhutilFrenchLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilFrenchLocale.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Locale for "French (France)".
+ */
+final class PhutilFrenchLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'fr_FR';
+ }
+
+ public function getLocaleName() {
+ return pht('French (France)');
+ }
+
+}
diff --git a/src/internationalization/locales/PhutilGermanLocale.php b/src/internationalization/locales/PhutilGermanLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilGermanLocale.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Locale for "German (Germany)".
+ */
+final class PhutilGermanLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'de_DE';
+ }
+
+ public function getLocaleName() {
+ return pht('German (Germany)');
+ }
+
+}
diff --git a/src/internationalization/locales/PhutilPortugueseBrazilLocale.php b/src/internationalization/locales/PhutilPortugueseBrazilLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilPortugueseBrazilLocale.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Locale for "Portuguese (Brazil)".
+ */
+final class PhutilPortugueseBrazilLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'pt_BR';
+ }
+
+ public function getLocaleName() {
+ return pht('Portuguese (Brazil)');
+ }
+
+}
diff --git a/src/internationalization/locales/PhutilPortuguesePortugalLocale.php b/src/internationalization/locales/PhutilPortuguesePortugalLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilPortuguesePortugalLocale.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Locale for "Portuguese (Portugal)".
+ */
+final class PhutilPortuguesePortugalLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'pt_PT';
+ }
+
+ public function getLocaleName() {
+ return pht('Portuguese (Portugal)');
+ }
+
+}
diff --git a/src/internationalization/locales/PhutilSimplifiedChineseChinaLocale.php b/src/internationalization/locales/PhutilSimplifiedChineseChinaLocale.php
new file mode 100644
--- /dev/null
+++ b/src/internationalization/locales/PhutilSimplifiedChineseChinaLocale.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * Locale for "Simplified Chinese (China)".
+ */
+final class PhutilSimplifiedChineseChinaLocale extends PhutilLocale {
+
+ public function getLocaleCode() {
+ return 'zh_CN';
+ }
+
+ public function getLocaleName() {
+ return pht('Simplified Chinese (China)');
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Oct 15, 8:06 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6712028
Default Alt Text
D15979.id.diff (9 KB)
Attached To
Mode
D15979: Provide locale support for languages we've seen translations for
Attached
Detach File
Event Timeline
Log In to Comment