I am able to use “<?= lang(‘<string>’) ?>” to get language specific strings in the templates in which PHP is enabled.
For the regular non-PHP templates, it is not clear how to achieve this. Is there a way that ExpressionEngine handles it without enabling PHP in the templates?
Thank you.
You can use the {language:your_key} Tag Pair (in EE Pro 6+ or with Add-ons). In newer versions (EE 6+), or with certain add-ons, you can create custom language variables and access them using tags like:
{language:welcome_message}
But this depends on your site setup and whether you’re using add-ons like Low Variables or Translations to manage these strings.
Thank you for responding. It is nice if language specific strings can be populated using EE tags, with no addon requirement.
Requesting some clarifications: 1. Is it possible to use {language:page_heading} or {language:welcome_message} without any add-on in EE 6+? How does EE figure out the UI language to map the “welcome_message” to the correct language specific string? 2. Is there an example of a template to understand the implementation better? For example, where to load the language file in the template? 3. Is there a link in the EE Docs where the details on creating multi-lingual sites are available?
Thank you again!
I’m a little fuzzy on where the page_heading or welcome_message variables are coming from. There are system message templates that have some of those types of variables and they are translatable by have a language file. If it’s on the frontend, output by the system and it’s parsed, it should be translatable by having a language file. And old member and forum ‘templates’ had their own very specific language variables that are parsed in specific templates (and translatable by language file).
But I don’t think that’s what you’re talking about?
Where is welcome_message or page_heading coming from in the above case?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.