PHP Class MultilingualPlugin, addons

You can trigger an alternate locale by adding 'locale' in the query string, setting var vanilla_embed_locale in an embedded forum, or selecting one of the language links added to the footer. User-selected locale takes precedence. The selected locale is stored in the session. If it is user-selected AND the user is logged in, it is stored in UserMeta.
Inheritance: extends Gdn_Plugin
Afficher le fichier Open project: vanilla/addons Class Usage Examples

Protected Properties

Свойство Type Description
$overrides

Méthodes publiques

Méthode Description
base_render_before ( $Sender ) Show alternate locale options in Foot.
enabledLocales ( ) : array Return the enabled locales suitable for local choosing.
gdn_dispatcher_afterAnalyzeRequest_handler ( $Sender ) Set user's preferred locale.
profileController_setLocale_create ( $Sender, $locale, $TK ) Allow user to set their preferred locale via link-click.

Méthodes protégées

Méthode Description
getAlternateLocale ( ) Get user preference or queried locale.
validateLocale ( string $Locale ) : string Confirm selected locale is valid and available.

Method Details

base_render_before() public méthode

Show alternate locale options in Foot.
public base_render_before ( $Sender )

enabledLocales() public static méthode

Return the enabled locales suitable for local choosing.
public static enabledLocales ( ) : array
Résultat array Returns an array in the form `[locale => localeName]`.

gdn_dispatcher_afterAnalyzeRequest_handler() public méthode

Moved event from AppStart to AfterAnalyzeRequest to allow Embed to set P3P header first.

getAlternateLocale() protected méthode

Get user preference or queried locale.
protected getAlternateLocale ( )

profileController_setLocale_create() public méthode

Allow user to set their preferred locale via link-click.
public profileController_setLocale_create ( $Sender, $locale, $TK )

validateLocale() protected méthode

Confirm selected locale is valid and available.
protected validateLocale ( string $Locale ) : string
$Locale string Locale code.
Résultat string Returns the canonical version of the locale on success or an empty string otherwise.

Property Details

$overrides protected_oe static_oe property

protected static $overrides