From c9b7820e313fbda07222eda0db85e971b37d9033 Mon Sep 17 00:00:00 2001 From: Lennart Rosam Date: Fri, 2 Aug 2013 09:41:31 +0200 Subject: [PATCH] Make default language configurable via config.php Conflicts: config/config.sample.php --- config/config.sample.php | 7 +++++-- lib/l10n.php | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php index aa81cb781a2..4a1eee331c9 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -56,7 +56,10 @@ $CONFIG = array( /* Theme to use for ownCloud */ "theme" => "", -/* Path to the 3rdparty directory */ +/* 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" => "", /* URL to the 3rdparty directory, as seen by the browser */ @@ -144,7 +147,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 1e07a9b9557..6d930994e7b 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -286,6 +286,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)) { -- 2.39.5