From 5b77b86ffbf93653268c11ccccd05e29510ad0d7 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 26 May 2016 07:46:47 -0700 Subject: [PATCH] Show translation option names natively, instead of in the current translation Summary: Ref T5267. Put "Deutsch" in the list instead of "German", so you can find your language without knowing the English word for it. Test Plan: {F1661598} Reviewers: chad Reviewed By: chad Maniphest Tasks: T5267 Differential Revision: https://secure.phabricator.com/D15980 --- src/__phutil_library_map__.php | 2 ++ .../panel/PhabricatorAccountSettingsPanel.php | 6 ++++++ .../translation/PhabricatorEmojiTranslation.php | 15 +++++++++++++++ .../PhabricatorVeryWowEnglishTranslation.php | 1 + 4 files changed, 24 insertions(+) create mode 100644 src/infrastructure/internationalization/translation/PhabricatorEmojiTranslation.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 76919876ec..6c5ac74685 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2383,6 +2383,7 @@ phutil_register_library_map(array( 'PhabricatorEmailVerificationController' => 'applications/auth/controller/PhabricatorEmailVerificationController.php', 'PhabricatorEmbedFileRemarkupRule' => 'applications/files/markup/PhabricatorEmbedFileRemarkupRule.php', 'PhabricatorEmojiRemarkupRule' => 'applications/macro/markup/PhabricatorEmojiRemarkupRule.php', + 'PhabricatorEmojiTranslation' => 'infrastructure/internationalization/translation/PhabricatorEmojiTranslation.php', 'PhabricatorEmptyQueryException' => 'infrastructure/query/PhabricatorEmptyQueryException.php', 'PhabricatorEnv' => 'infrastructure/env/PhabricatorEnv.php', 'PhabricatorEnvTestCase' => 'infrastructure/env/__tests__/PhabricatorEnvTestCase.php', @@ -6912,6 +6913,7 @@ phutil_register_library_map(array( 'PhabricatorEmailVerificationController' => 'PhabricatorAuthController', 'PhabricatorEmbedFileRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PhabricatorEmojiRemarkupRule' => 'PhutilRemarkupRule', + 'PhabricatorEmojiTranslation' => 'PhutilTranslation', 'PhabricatorEmptyQueryException' => 'Exception', 'PhabricatorEnv' => 'Phobject', 'PhabricatorEnvTestCase' => 'PhabricatorTestCase', diff --git a/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php b/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php index 176e4ce66b..274e44f15e 100644 --- a/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php @@ -102,7 +102,13 @@ final class PhabricatorAccountSettingsPanel extends PhabricatorSettingsPanel { $translations = array(); foreach ($locales as $locale) { $code = $locale->getLocaleCode(); + + // Get the locale's localized name if it's available. For example, + // "Deutsch" instead of "German". This helps users who do not speak the + // current language to find the correct setting. + $raw_scope = PhabricatorEnv::beginScopedLocale($code); $name = $locale->getLocaleName(); + unset($raw_scope); if ($locale->isSillyLocale()) { if ($is_serious) { diff --git a/src/infrastructure/internationalization/translation/PhabricatorEmojiTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorEmojiTranslation.php new file mode 100644 index 0000000000..40ea2e8829 --- /dev/null +++ b/src/infrastructure/internationalization/translation/PhabricatorEmojiTranslation.php @@ -0,0 +1,15 @@ + "\xF0\x9F\x92\xAC (\xF0\x9F\x8C\x8D)", + ); + } +} diff --git a/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php index b269fcfed2..cbb3e3bc4a 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorVeryWowEnglishTranslation.php @@ -33,6 +33,7 @@ final class PhabricatorVeryWowEnglishTranslation 'Prototype' => 'Chew Toy', 'Continue' => 'Bark And Run', 'Countdown to Events' => 'To the Moon!', + 'English (Very Wow)' => 'Such English', ); } }