i18n documentation - added note for caching in multi language modules

This commit is contained in:
ARNHOE 2013-09-07 16:10:52 +02:00
parent 8864256601
commit 68141b6ca0

View File

@ -205,6 +205,17 @@ the PHP version of the function.
// Using injection to add variables into the translated strings (note that $Name and $Greeting must be available in the current template scope).
<%t Header.Greeting "Hello {name} {greeting}" name=$Name greeting=$Greeting %>
#### Caching in Template Files with locale switching
When caching a `<% loop %>` or `<% with %>` with `<%t params %>`. It is important to add the Locale to the cache key otherwise it won't pick up locale changes.
::::ss
<% cached 'MyIdentifier', $CurrentLocale %>
<% loop $Students %>
$Name
<% end_loop %>
<% end_cached %>
## Collecting text