We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Locale specific strings in templates

How Do I?

maneesh's avatar
maneesh
31 posts
7 months ago
maneesh's avatar maneesh

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.

       
laurayoung's avatar
laurayoung
4 posts
7 months ago
laurayoung's avatar laurayoung

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.

       
maneesh's avatar
maneesh
31 posts
7 months ago
maneesh's avatar maneesh

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!

       
Robin Sowell's avatar
Robin Sowell
13,255 posts
7 months ago
Robin Sowell's avatar Robin Sowell

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?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.