Tips and Tricks - #7
Can I display different text to every language site?
Yes for simple text in template or in module/tag with a calling param (check help if exist).
Use
Translationmanager module! A very simple howto:
- Install this module
- Read module help
- Go in "New/Import language" tab and select your languages. For use from old method, import your MLE languages selecting MLE strings in 2b. In other case Add new language (2a)
- Set your Default language
- In template use {tr_key key="your_key" lang="$lang" assign="mystring"} before of use.
Now you have $mystring smarty variable for generic use {$mystring} or calling module/tag: {breadcrumbs starttext=$mystring}
OLD method
DEPRECATED:
In
mle folder there is a subdirecory
lang. In this folder there are language files for
whole site.
If not exist your
locale.php file, copy from en_US.php to your locale file (ex: en_AU.php); open and add a new row in
all your language files of your site (view example in file):
Code: Select all
/* 'key' => 'string of your text', */
'my_text_template' => 'translation_of_my_text_template_in_this_locale',
'you_are_here' => 'translation_of_you_are_here_in_this_locale',
best practices:
- for 'key' use normal, lower and no space character, it's a small string that remember your text;
- for 'string of your text' pay attention to your encode/charset (use a tool online, for example
UTF-8) or transform your text in html entity (search in google for this or
here there is a table conversion);
Tomorrow.................. I think for a complete db tool
After use in template or in calling module/tag with
{$mle_translation.key}:
Text in template:
.......
{$mle_translation.my_text_template}
.......
Calling module/tag:
{breadcrumbs starttext=`$mle_translation.you_are_here`}
Alby