84 'sma' =>
'Åarjelh-saemien giele',
95 'lb' =>
'Lëtzebuergesch',
97 'sl' =>
'Slovenščina',
98 'lt' =>
'Lietuvių kalba',
101 'pl' =>
'Język polski',
103 'pt-br' =>
'Português brasileiro',
104 'ru' =>
'русский язык',
105 'et' =>
'eesti keel',
115 'id' =>
'Bahasa Indonesia',
143 $this->defaultLanguage = $this->configuration->getString(
'language.default',
'en');
144 $this->languageParameterName = $this->configuration->getString(
'language.parameter.name',
'language');
145 $this->customFunction = $this->configuration->getArray(
'language.get_language_function',
null);
146 $this->rtlLanguages = $this->configuration->getArray(
'language.rtl', array());
147 if (isset(
$_GET[$this->languageParameterName])) {
149 $_GET[$this->languageParameterName],
150 $this->configuration->getBoolean(
'language.parameter.setcookie',
true)
163 $configuredAvailableLanguages = $this->configuration->getArray(
'language.available', array(
'en'));
165 foreach ($configuredAvailableLanguages as
$code) {
166 if (array_key_exists(
$code, $this->language_names) && isset($this->language_names[
$code])) {
185 if (isset($this->languagePosixMapping[
$language])) {
186 return $this->languagePosixMapping[
$language];
201 if (in_array(
$language, $this->availableLanguages,
true)) {
203 if ($setLanguageCookie ===
true) {
221 if (isset($this->language)) {
226 if (isset($this->customFunction) && is_callable($this->customFunction)) {
227 $customLanguage = call_user_func($this->customFunction, $this);
228 if ($customLanguage !==
null && $customLanguage !==
false) {
229 return $customLanguage;
235 if ($languageCookie !==
null) {
236 $this->language = $languageCookie;
237 return $languageCookie;
242 if ($httpLanguage !==
null) {
243 return $httpLanguage;
260 if (array_key_exists(
$code, $this->language_names) && isset($this->language_names[
$code])) {
261 return $this->language_names[
$code];
293 $bestLanguage =
null;
296 foreach ($languageScore as
$language => $score) {
298 if (array_key_exists(
$language, $languageMap)) {
302 if (!in_array(
$language, $this->availableLanguages,
true)) {
311 if ($score > $bestScore) {
317 return $bestLanguage;
339 if (isset(self::$defaultLanguageMap[$langcode])) {
340 return self::$defaultLanguageMap[$langcode];
356 $list = array_fill_keys($this->availableLanguages,
false);
369 return in_array($this->
getLanguage(), $this->rtlLanguages,
true);
382 $name =
$config->getString(
'language.cookie.name',
'language');
413 $name =
$config->getString(
'language.cookie.name',
'language');
415 'lifetime' => (
$config->getInteger(
'language.cookie.lifetime', 60 * 60 * 24 * 900)),
416 'domain' => (
$config->getString(
'language.cookie.domain',
null)),
417 'path' => (
$config->getString(
'language.cookie.path',
'/')),
418 'secure' => (
$config->getBoolean(
'language.cookie.secure',
false)),
419 'httponly' => (
$config->getBoolean(
'language.cookie.httponly',
false)),
An exception for terminatinating execution or to throw for unit testing.
static getLanguageCookie()
Retrieve the user-selected language from a cookie.
static setLanguageCookie($language)
This method will attempt to set the user-selected language in a cookie.
getLanguageCodeAlias($langcode)
Return an alias for a language code, if any.
getLanguageList()
Return an indexed list of all languages available.
isLanguageRTL()
Check whether a language is written from the right to the left or not.
getDefaultLanguage()
Return the default language according to configuration.
getInstalledLanguages()
Filter configured (available) languages against installed languages.
getLanguage()
This method will return the language selected by the user, or the default language.
getPosixLanguage($language)
Rename to non-idiosyncratic language code.
__construct(\SimpleSAML_Configuration $configuration)
Constructor.
getLanguageLocalizedName($code)
Get the localized name of a language, by ISO 639-2 code.
getLanguageParameterName()
Get the language parameter name.
getHTTPLanguage()
This method returns the preferred language for the user based on the Accept-Language HTTP header.
static $defaultLanguageMap
This is the default language map.
setLanguage($language, $setLanguageCookie=true)
This method will set a cookie for the user's browser to remember what language was selected.
static setCookie($name, $value, $params=null, $throw=true)
Set a cookie.
static getAcceptLanguage()
This function parses the Accept-Language HTTP header and returns an associative array with each langu...
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
if(isset($_REQUEST['delete'])) $list