Initialize and set locale for SSO

package sso\lib

 Methods

Retrieve all availables locales

availables() : array<mixed,string>
Static

Returns

array<mixed,string>locale => locale text

Initialize locales constants for SSO and SALT

init() 
Static

Register current locale in cookie

set(string $locale) : boolean
Static

Parameters

$locale

string

locale to set

Returns

booleanTRUE if cookie is set, FALSE otherwise.

Normalize a locale

normalizeLocale(string $locale) : string
Static

Parameters

$locale

string

locale to normalize

Returns

stringnormalized locale, with only [a-z0-9_]

Retrieve locales to use

retrieveLocales() : array<mixed,string>
Static

Returns

array<mixed,string>List of locale, by preference order

 Properties

 

List all available locales, for SALT and SSO

$AVAILABLE_LOCALES : array<mixed,mixed>

Default

array(self::SALT_LOCALE => array('fr' => 'Français', 'en' => 'English'), self::SSO_CURRENT_LOCALE => array('fr' => 'Français', 'en' => 'English'))
Static

 Constants

   

Name of SALT locale constant

SALT_LOCALE = 'salt\I18N_LOCALE' 
 

Name of SSO locale constant

SSO_CURRENT_LOCALE = 'sso\SSO_CURRENT_LOCALE'