Translating
In addition to consistent words and phrases, language file strings may also use the following constructs within them:
- Using named tags, like
[Count],[Name],[Id],[Type],[Module],[OldStatus],[NewStatus],[NewId],[OldId],[Function],[Exist],[Added],[LINK],[EXT] etc
- Using
%s
for string replacements
In the first two examples, WHASOLS will replace them into the final output for the string at the time of it's usage, so it is necessary to keep them intact and untranslated in your translations. So Variable in []
will always be replace with dynamic data automatically.
For the string replacement %s
type, the number and order of %s
should not be changed as the product will replace the %s
values in order from starting to end.
Examples
$_LANG['examplestring'] = "The price you will pay today is [Price]";
Correct Translation = “ The price you will pay today is :price “ Incorrect Translation = “ The price you will pay today is :‘ay’ “
This would display :‘ay’ instead of the price on the translated page.
$_LANG['examplestring'] = "Today is a good day to purchase your domain [Domain] for cheap!";
Correct Translation = “ Today is a good day to purchase your domain $domain for cheap “ Incorrect Translation = “ Today is a good day to purchase your domain for cheap“