Translations
Translations are a collection of strings in different that helps displaying your web site in different languages. Translations are managed in the backend app Translations
.
Key Naming
We try try to keep consistent naming for the translation keys. Here are some descriptive examples:
Key Example Description
title_this_is_a_title Used for titles e.g. "This Is a Title".
text_this_is_a_text Used for text sentences e.g. "This is a text".
abr_etc Used for abrevations e.g. "etc."
specific_component:keyname Used for module specific components e.g. "index:head_title" or "pm_paypal:description_option".
Code Examples
Output a translation
echo language::translate('title_hello');
Output a translation and inject the english translation to the database
echo language::translate('title_hello', 'Hello');
Output a translation for a specific language
echo language::translate('title_hello', 'Hello', $language_code);