Get started with PHP-Fusion

Locales Explained
PHP-Fusion Locales Expained.
You can find Language Packs in Downloads

Locales explained

All text in a PHP-Fusion site can be located in files we call Locales,
This gives the site owners and the site users the ability to change both the displayed Language and the Language of the content.

There are many Locales available for the Core and a lot of Addons have separate Locales for download.
You will find our Core Locales in the Download Locale Packs section.


Each Addon need to provide with their own Locales, these can usually be found either included in the Addon by the Author or submitted to the Addon from a user contribution. If the later is the case you will find it under the Translations in the AddonDB for each Addon that contains one ore more user submitted Locales.


To change or add to your sites Core Languages,you must first upload the requested Locale(s) to your respective Locale folder.
Each Infusion, Panel, Theme etc have their own Locale folders.


You can control the site´s Main Language from Administration -> Settings -> Language Settings and select desired locale in the Site locale droplist.
You can control the additional site Locale´s from Administration -> Settings -> Language Settings and tick each requested Locale listed in Enabled Languages


PHP-Fusion as well as properly formatted Addons will first search for your users Locale Setting and then for Site´s Locale settings as default.
Once the settings have been read the system will try to verify if there is a respective Locale file in that Language.
If the system locates the asked Language file it will be loaded for display. If none is found, it will default to English.


This is our standard code for Locale control.

Code Gist:
// Check if a locale file is available that match the selected Locale.
If (file_exists(INFUSIONS."your_panel/locale/".LANGUAGE.".php")) {
   // Load the Locale file matching selection.
   include INFUSIONS."your_panel/locale/".LANGUAGE.".php";
} else {
   // Load the default Locale file if the above checks fail.
   include INFUSIONS."your_panel/locale/English.php";
}


See also …


References