]> source.dussan.org Git - nextcloud-server.git/commitdiff
provide a way to detect the language that is being used (e.g. for clientside javascri...
authorBernhard Posselt <dev@bernhard-posselt.com>
Tue, 13 May 2014 23:06:14 +0000 (01:06 +0200)
committerBernhard Posselt <dev@bernhard-posselt.com>
Tue, 13 May 2014 23:09:48 +0000 (01:09 +0200)
lib/private/l10n.php
lib/public/il10n.php

index c9d9e8131b1d5b84df850b593896b532150afea7..40eeb98d6bb27bb6ce4536d08a5893aabfb0ca93 100644 (file)
@@ -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
index c228be6a0a34799b6a334c3127fac6821eae0f80..7649a1ea538bd12ea17527551458907c72e56907 100644 (file)
@@ -72,4 +72,18 @@ interface IL10N {
         *    - params: timestamp (int/string)
         */
        public function l($type, $data);
+
+
+       /**
+        * @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);
 }