summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-04-15 16:57:38 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-04-15 16:57:38 +0200
commit242b3e240d420ab30b169605f6b06939069c0614 (patch)
treec2ed018bc57298abc089d7124bd44528a5e0cc21
parent2eeab60378a3e22e19c4f435aa2bf65cc9da7c2a (diff)
parent596177727afbab9950d29d44af94e4d03814ce72 (diff)
downloadnextcloud-server-242b3e240d420ab30b169605f6b06939069c0614.tar.gz
nextcloud-server-242b3e240d420ab30b169605f6b06939069c0614.zip
Merge pull request #8209 from owncloud/set-language-explicitly-master
Set language explicitly master
-rw-r--r--lib/private/l10n.php8
-rw-r--r--ocs/v1.php3
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php
index 175360e27a3..a397945b829 100644
--- a/lib/private/l10n.php
+++ b/lib/private/l10n.php
@@ -419,6 +419,14 @@ class OC_L10N implements \OCP\IL10N {
}
/**
+ * The given language is forced to be used while executing the current request
+ * @param string $lang
+ */
+ public static function forceLanguage($lang) {
+ self::$language = $lang;
+ }
+
+ /**
* @brief find the best language
* @param array|string $app details below
* @returns string language
diff --git a/ocs/v1.php b/ocs/v1.php
index 62a3511e611..d69904fc495 100644
--- a/ocs/v1.php
+++ b/ocs/v1.php
@@ -30,6 +30,9 @@ try {
// load all apps to get all api routes properly setup
OC_App::loadApps();
+ // api calls always will return English
+ \OC_L10N::forceLanguage('en');
+
OC::$server->getRouter()->match('/ocs'.OC_Request::getRawPathInfo());
} catch (ResourceNotFoundException $e) {
OC_API::setContentType();