1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Don't show "Limited" or "Test" translations unless an install is in developer mode

Summary:
Ref T5267. Although translations with very few strings are already put into a "Limited Translations" group, this isn't necessarily clear and was empirically confusing to at least one user, who was surprised that selecting "Spanish" had no UI effect.

Instead, hide limited and test translations entirely unless the install is in developer mode.

Test Plan: In a non-developer-mode install, viewed translations menu. No longer saw translations with very few strings.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5267

Differential Revision: https://secure.phabricator.com/D16807
This commit is contained in:
epriestley 2016-11-06 09:14:22 -08:00
parent 960c0be689
commit 2f93ce4c25

View file

@ -32,7 +32,6 @@ final class PhabricatorTranslationSetting
}
protected function getSelectOptionGroups() {
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
$locales = PhutilLocale::loadAllLocales();
$group_labels = array(
@ -56,10 +55,6 @@ final class PhabricatorTranslationSetting
unset($raw_scope);
if ($locale->isSillyLocale()) {
if ($is_serious) {
// Omit silly locales on serious business installs.
continue;
}
$groups['silly'][$code] = $name;
continue;
}
@ -89,6 +84,20 @@ final class PhabricatorTranslationSetting
$groups[$type][$code] = $name;
}
// Omit silly locales on serious business installs.
$is_serious = PhabricatorEnv::getEnvConfig('phabricator.serious-business');
if ($is_serious) {
unset($groups['silly']);
}
// Omit limited and test translations if Phabricator is not in developer
// mode.
$is_dev = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
if (!$is_dev) {
unset($groups['limited']);
unset($groups['test']);
}
$results = array();
foreach ($groups as $key => $group) {
$label = $group_labels[$key];