PHP Class Piwik\Plugins\LanguagesManager\LanguagesManager

Inheritance: extends Piwik\Plugin
Datei anzeigen Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
addLanguagesManagerToOtherTopBar ( &$str ) Adds the languages drop-down list to topbars other than the main one rendered in CoreHome/templates/top_bar.twig. The 'other' topbars are on the Installation and CoreUpdater screens.
deleteUserLanguage ( $userLogin )
getJsFiles ( &$jsFiles )
getLanguageCodeForCurrentUser ( ) : string
getLanguageForSession ( ) : string | null Returns the language for the session
getLanguageNameForCurrentUser ( ) : string
getLanguagesSelector ( ) : string Renders and returns the language selector HTML.
initLanguage ( )
install ( )
jsGlobalVariables ( &$str ) Adds the languages drop-down list to topbars other than the main one rendered in CoreHome/templates/top_bar.twig. The 'other' topbars are on the Installation and CoreUpdater screens.
registerEvents ( )
setLanguageForSession ( string $languageCode ) : boolean Set the language for the session
uninstall ( )
uses12HourClockForCurrentUser ( ) : boolean

Protected Methods

Method Description
getLanguageFromPreferences ( ) : string | false

Method Details

addLanguagesManagerToOtherTopBar() public method

Adds the languages drop-down list to topbars other than the main one rendered in CoreHome/templates/top_bar.twig. The 'other' topbars are on the Installation and CoreUpdater screens.

deleteUserLanguage() public method

public deleteUserLanguage ( $userLogin )

getJsFiles() public method

public getJsFiles ( &$jsFiles )

getLanguageCodeForCurrentUser() public static method

public static getLanguageCodeForCurrentUser ( ) : string
return string Two letters language code, eg. "fr"

getLanguageForSession() public static method

Returns the language for the session
public static getLanguageForSession ( ) : string | null
return string | null

getLanguageFromPreferences() protected static method

protected static getLanguageFromPreferences ( ) : string | false
return string | false if language preference could not be loaded

getLanguageNameForCurrentUser() public static method

public static getLanguageNameForCurrentUser ( ) : string
return string Full english language string, eg. "French"

getLanguagesSelector() public method

Renders and returns the language selector HTML.
public getLanguagesSelector ( ) : string
return string

initLanguage() public method

public initLanguage ( )

install() public method

public install ( )

jsGlobalVariables() public method

Adds the languages drop-down list to topbars other than the main one rendered in CoreHome/templates/top_bar.twig. The 'other' topbars are on the Installation and CoreUpdater screens.
public jsGlobalVariables ( &$str )

registerEvents() public method

See also: Piwik\Plugin::registerEvents
public registerEvents ( )

setLanguageForSession() public static method

Set the language for the session
public static setLanguageForSession ( string $languageCode ) : boolean
$languageCode string ISO language code
return boolean

uninstall() public method

public uninstall ( )

uses12HourClockForCurrentUser() public static method

public static uses12HourClockForCurrentUser ( ) : boolean
return boolean