PHP 클래스 SimpleSAML\Locale\Language

파일 보기 프로젝트 열기: simplesamlphp/simplesamlphp 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( SimpleSAML_Configuration $configuration ) Constructor
getDefaultLanguage ( ) : string Return the default language according to configuration.
getLanguage ( ) : string This method will return the language selected by the user, or the default language. It looks first for a cached language code, then checks for a language cookie, then it tries to calculate the preferred language from HTTP headers.
getLanguageCodeAlias ( $langcode ) : string Return an alias for a langcode, if any
getLanguageCookie ( ) : string | null Retrieve the user-selected language from a cookie.
getLanguageList ( ) : array Return an indexed list of all languages available.
getLanguageLocalizedName ( string $code ) : string Get the localized name of a language, by ISO 639-2 code.
getLanguageParameterName ( ) : string Get the language parameter name.
getPosixLanguage ( $language ) * Rename to non-idiosyncratic language code
isLanguageRTL ( ) : boolean Check whether a language is written from the right to the left or not.
setLanguage ( string $language, boolean $setLanguageCookie = true ) This method will set a cookie for the user's browser to remember what language was selected.
setLanguageCookie ( string $language ) This method will attempt to set the user-selected language in a cookie. It will do nothing if the language specified is not in the list of available languages, or the headers have already been sent to the browser.

비공개 메소드들

메소드 설명
getHTTPLanguage ( ) : string This method returns the preferred language for the user based on the Accept-Language HTTP header.
getInstalledLanguages ( ) : array Wash configured (available) languages against installed languages

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( SimpleSAML_Configuration $configuration )
$configuration SimpleSAML_Configuration Configuration object

getDefaultLanguage() 공개 메소드

Return the default language according to configuration.
public getDefaultLanguage ( ) : string
리턴 string The default language that has been configured. Defaults to english if not configured.

getLanguage() 공개 메소드

This method will return the language selected by the user, or the default language. It looks first for a cached language code, then checks for a language cookie, then it tries to calculate the preferred language from HTTP headers.
public getLanguage ( ) : string
리턴 string The language selected by the user according to the processing rules specified, or the default language in any other case.

getLanguageCodeAlias() 공개 메소드

Return an alias for a langcode, if any
public getLanguageCodeAlias ( $langcode ) : string
리턴 string The alias, or null if alias not found

getLanguageCookie() 공개 정적인 메소드

Retrieve the user-selected language from a cookie.
public static getLanguageCookie ( ) : string | null
리턴 string | null The selected language or null if unset.

getLanguageList() 공개 메소드

Return an indexed list of all languages available.
public getLanguageList ( ) : array
리턴 array An array holding all the languages available as the keys of the array. The value for each key is true in case that the language specified by that key is currently active, or false otherwise.

getLanguageLocalizedName() 공개 메소드

Get the localized name of a language, by ISO 639-2 code.
public getLanguageLocalizedName ( string $code ) : string
$code string The ISO 639-2 code of the language.
리턴 string The localized name of the language.

getLanguageParameterName() 공개 메소드

Get the language parameter name.
public getLanguageParameterName ( ) : string
리턴 string The language parameter name.

getPosixLanguage() 공개 메소드

* Rename to non-idiosyncratic language code
public getPosixLanguage ( $language )
$language Language code for the language to rename, if neccesary.

isLanguageRTL() 공개 메소드

Check whether a language is written from the right to the left or not.
public isLanguageRTL ( ) : boolean
리턴 boolean True if the language is right-to-left, false otherwise.

setLanguage() 공개 메소드

This method will set a cookie for the user's browser to remember what language was selected.
public setLanguage ( string $language, boolean $setLanguageCookie = true )
$language string Language code for the language to set.
$setLanguageCookie boolean Whether to set the language cookie or not. Defaults to true.

setLanguageCookie() 공개 정적인 메소드

This method will attempt to set the user-selected language in a cookie. It will do nothing if the language specified is not in the list of available languages, or the headers have already been sent to the browser.
public static setLanguageCookie ( string $language )
$language string The language set by the user.