Merge pull request #2395 from ARNHOE/patch-1

i18n documentation - added note for caching in multi language modules
This commit is contained in:
Ingo Schommer 2013-10-23 03:02:06 -07:00
commit 634f73c710

View File

@ -212,6 +212,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