Locale | Summit
Locale is a class to handle localization allowing you to offer your web application in different languages. Words you designate can be interchanged with the different languages your application supports.
Configuration
Below are the configuration variables for the database.
| Option | Description |
|---|---|
| default_language | The default language when none is selcted, or if a key doesn't exist it will load from this language |
Methods
Init($config)
The Init method loads the default locale based on your configuration.
Usage:
Locale::Init($config);
Locale::Init($config);
GetLang($key)
GetLang replaces the key with the text from the language currently loaded. If no key exists for the selected language it will use the default language key.
Usage:
Locale::GetLang('some_key');
Locale::GetLang('some_key');
LoadLocale($language)
LoadLocale will change the current language. This will allow for quickly changing the language for your users.
Usage:
Locale::LoadLocale('en-US');
Locale::LoadLocale('en-US');
UnloadLocale
UnloadLocale will unload the current language and use the default language.
Usage:
Locale::UnloadLocale();
Locale::UnloadLocale();

