provide a way to detect the language that is being used (e.g. for clientside javascript language selection

This commit is contained in:
Bernhard Posselt 2014-05-14 01:06:14 +02:00
parent 166f2af5d8
commit 512373fadf
2 changed files with 31 additions and 0 deletions

View 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

View 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);
}