Page MenuHomePhabricator

How to set server default language
Closed, DuplicatePublic

Description

The Account Settings panel allows a user to change their preferred UI language. The default is "Server Default: English (US)". However, I am unable to find a config option to set this server default.

I had a look in the UI config and the Translations config as well as searching through all options for "translation" and "language".

Event Timeline

devurandom raised the priority of this task from to Needs Triage.
devurandom updated the task description. (Show Details)
devurandom added a subscriber: devurandom.

Oh, haha, there is nothing useful in there.

But where does "Server Default" come from? Apparently there is a default set somewhere, I just cannot find it…

The default can be changed using following patch (cf. P1821):

diff --git a/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php b/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php
index 72a2252..b233ba0 100644
--- a/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorAccountSettingsPanel.php
@@ -72,7 +72,7 @@ final class PhabricatorAccountSettingsPanel extends PhabricatorSettingsPanel {
 
     asort($translations);
     // TODO: Implement "locale.default" and use it here.
-    $default = 'en_US';
+    $default = 'en_P*';
     $translations = array(
       '' => pht('Server Default: %s', $locales[$default]->getLocaleName()),
     ) + $translations;
diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php
index d5c4c34..3c09d0b 100644
--- a/src/infrastructure/env/PhabricatorEnv.php
+++ b/src/infrastructure/env/PhabricatorEnv.php
@@ -126,7 +126,7 @@ final class PhabricatorEnv extends Phobject {
 
     // TODO: Add a "locale.default" config option once we have some reasonable
     // defaults which aren't silly nonsense.
-    self::setLocaleCode('en_US');
+    self::setLocaleCode('en_P*');
   }
 
   public static function beginScopedLocale($locale_code) {