diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-14 01:06:14 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-14 01:09:48 +0200 |
commit | 512373fadf64c4ea982e12d921684b298f112314 (patch) | |
tree | 6cfea505de7190656fd23f693b27504136b2cbb3 /lib/private/l10n.php | |
parent | 166f2af5d871d3bfd86021eec3bf8d0078073f5b (diff) | |
download | nextcloud-server-512373fadf64c4ea982e12d921684b298f112314.tar.gz nextcloud-server-512373fadf64c4ea982e12d921684b298f112314.zip |
provide a way to detect the language that is being used (e.g. for clientside javascript language selection
Diffstat (limited to 'lib/private/l10n.php')
-rw-r--r-- | lib/private/l10n.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index c9d9e8131b1..40eeb98d6bb 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -401,6 +401,23 @@ class OC_L10N implements \OCP\IL10N { self::$language = $lang; } + + /** + * @brief find the best language + * @param array|string $app details below + * @returns string language + * + * If $app is an array, ownCloud assumes that these are the available + * languages. Otherwise ownCloud tries to find the files in the l10n + * folder. + * + * If nothing works it returns 'en' + */ + public function getLanguageCode($app=null) { + return self::findLanguage($app); + } + + /** * @brief find the best language * @param array|string $app details below |