FfLanguageHelper
public class FfLanguageHelper
Field Summary | |
---|---|
mixed | The current language or the language associated with the user instance. |
mixed | The local path to the translation file. |
mixed | A an array of arrays where the 1st row is the language headings where the index is the value of the 1st column or label. |
mixed | True if the translations file has been loaded. |
Constructor Summary | |
---|---|
Creates a new FfLanguageHelper. |
|
Creates a new FfLanguageHelper. |
Method Summary | |
---|---|
string | Returns the current language. |
void | Loads the translations file if needed: if the translations file hasn't been loaded. |
void | setLanguage(string language) Sets the current language. |
void | setTranslationFilename(string translationFilename) Sets the translation filename and sets the translationsLoaded value to false. |
mixed | translate(mixed label) Returns the translation(s) for the given label(s). |
string | translateLabel(string label) Returns the translation for the given label. |
public mixed $language
The current language or the language associated with the user instance.
public mixed $translationFilename
The local path to the translation file.
public mixed $translations
A an array of arrays where the 1st row is the language headings where the index is the value of the 1st column or label. For the following rows: the 1st element is the label and the following elements are the translations associated with the column headings.
public mixed $translationsLoaded = false
True if the translations file has been loaded.
public FfLanguageHelper()
Creates a new FfLanguageHelper.
public __construct()
Creates a new FfLanguageHelper.
public string getLanguage()
Returns the current language.
public void loadTranslationsIfNeeded()
Loads the translations file if needed: if the translations file hasn't been loaded.
public void setLanguage(string language)
Sets the current language.
public void setTranslationFilename(string translationFilename)
Sets the translation filename and sets the translationsLoaded value to false.
public mixed translate(mixed label)
Returns the translation(s) for the given label(s). If the $GLOBALS["FF_LANGUAGE_NATIVE_SHORTCUT"] is set to true then if the current language is the same as the native language then the label(s) are immediately returned. If not, the translation file is loaded, if not already loaded, and the appropriate translation(s) are returned according to the current language.
public string translateLabel(string label)
Returns the translation for the given label. If the $GLOBALS["FF_LANGUAGE_NATIVE_SHORTCUT"] is set to true then if the current language is the same as the native language then the label is immediately returned. If not, the translation file is loaded, if not already loaded, and the appropriate translation is returned according to the current language.
FfLanguageHelper a class used to implement multilanguage support.