diff options
-rw-r--r-- | lib/private/l10n.php | 8 | ||||
-rw-r--r-- | ocs/v1.php | 3 |
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(); |