diff options
author | Lennart Rosam <lennart.rosam@medien-systempartner.de> | 2013-08-02 09:41:31 +0200 |
---|---|---|
committer | Lennart Rosam <lennart.rosam@medien-systempartner.de> | 2013-08-02 09:41:31 +0200 |
commit | 79351d064f5471862c652f61eef1f221ad6cb59f (patch) | |
tree | 84eb7fe6bf8e1e3808933a08c46c7f4023c7a509 | |
parent | 16726ab79380067a6083bc42d6c51e2214ec54a3 (diff) | |
download | nextcloud-server-79351d064f5471862c652f61eef1f221ad6cb59f.tar.gz nextcloud-server-79351d064f5471862c652f61eef1f221ad6cb59f.zip |
Make default language configurable via config.php
-rw-r--r-- | config/config.sample.php | 5 | ||||
-rw-r--r-- | lib/l10n.php | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 8d978ea6ee7..bcf8ebdedb0 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -56,6 +56,9 @@ $CONFIG = array( /* Theme to use for ownCloud */ "theme" => "", +/* Optional ownCLoud default language - overrides automatic language detection on public pages like login or shared items. This has no effect on the users's language preference configured under "personal -> language" once they have logged in */ +"default_language" => "en", + /* Path to the parent directory of the 3rdparty directory */ "3rdpartyroot" => "", @@ -154,7 +157,7 @@ $CONFIG = array( /* Enable/disable X-Frame-Restriction */ /* HIGH SECURITY RISK IF DISABLED*/ "xframe_restriction" => true, - + /* The directory where the user data is stored, default to data in the owncloud * directory. The sqlite database is also stored here, when sqlite is used. */ diff --git a/lib/l10n.php b/lib/l10n.php index d35ce5fed14..a28aa89c5f1 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -298,6 +298,12 @@ class OC_L10N{ } } + $default_language = OC_Config::getValue('default_language', false); + + if($default_language !== false) { + return $default_language; + } + if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $accepted_languages = preg_split('/,\s*/', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE'])); if(is_array($app)) { |