Internationalisation (LAN)
Last updated
Last updated
Your website can be used in different languages. In order for your plugin or theme areas to be displayed in a specific language, it needs to be translated.
You should always include the English language files in your plugin!
There are three types of language files that can be used in your plugin.
Language Terms are more commonly known as LAN's. You can define LAN's by using PHP constants:
Examples are words such as 'and', 'to' and so on. There aren't always equivalents in other languages.
To load a language file from a plugin folder, use e107::lan()
:
This will include the following paths:
Always use the format LAN_PLUGIN_{FOLDER}_{TYPE} to prevent conflicts.
If defining terms for admin, always search lan_admin.php
for existing LANs which may match what you require.
If embedding values into a phrase, use substitution.
Use brackets [..]
and values such as x, y, z. See examples below.
Language File
Usage
English_front.php
Used only for the frontend of your plugin
English_admin.php
Used only for the Admin Area of your plugin
English_global.php
Used site-wide, for example in plugin.xml, files such asxxxx_menu.php
or addons.