The Localized Text plugin returns a localized version of the text specified by the {exp:localized_text} tag.
Example Usage
This EE Code:
{exp:localized_text string="search_module_name" file="search" language="english"}
Returns this text:
Search
Parameters
string - The string parameter is required. If the string parameter is omitted, no text will be returned.
The string parameter should contain the localized text key for which you want the value returned.
file - The file parameter is required. If the file parameter is omitted or invalid, the original text code contained within the string parameter will be returned.
The file parameter should contain the name of the module, plugin, or extension from which you want to pull the localized text. It should be provided exactly as it appears in the languages folder (without the prefix “lang.” or suffix “.php”).
language - The language parameter is optional. If the language parameter is omitted or invalid, the user’s default language will be used (or if the user is anonymous, the system’s default language will be used).
If the text contained within the string parameter does not exist in the specified file or language, the original text code will be returned.
Custom Language Files
This plugin can be used to create custom language files.
Simply create files named “lang.my_localized_text.php” in your languages folders. (my_localized_text can be any string, though be careful to avoid conflicting with other files.) Examine an already existing language file for examples of how to setup the array keys and values.
