provide a way to detect the language that is being used (e.g. for clientside javascript language selection
This commit is contained in:
parent
166f2af5d8
commit
512373fadf
|
@ -401,6 +401,23 @@ class OC_L10N implements \OCP\IL10N {
|
||||||
self::$language = $lang;
|
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
|
* @brief find the best language
|
||||||
* @param array|string $app details below
|
* @param array|string $app details below
|
||||||
|
|
|
@ -72,4 +72,18 @@ interface IL10N {
|
||||||
* - params: timestamp (int/string)
|
* - params: timestamp (int/string)
|
||||||
*/
|
*/
|
||||||
public function l($type, $data);
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue