Language call fix

This commit is contained in:
Dennis Eichhorn 2017-08-11 20:45:45 +02:00
parent 766d5040b3
commit 4f165660cd
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ In case the response header is set to JSON the view will automatically get parse
The base view class contains the request as well as the response objects hence it also contains the request/response localization. One of the most important methods is the `getText()` method. This private method allows for module and theme specific translations of defined language elements.
In the template you can simply use `$this->getText({TEXT_ID})` for localized text. All other localization elements can be accessed in a similar way e.g. `$this->l11n->getTemperature()`
In the template you can simply use `$this->getHtml({TEXT_ID})` for localized text. All other localization elements can be accessed in a similar way e.g. `$this->l11n->getTemperature()`
## Templates

View File

@ -7,13 +7,13 @@ Most of the localization is stored inside the localization object which is part
Language specific text can be used through the `LocalizationManager`, either by directly calling the `getText()` function of the localization manager
```
$this->l11nManager->getText({LANGUAGE}, {MODULE}, {THEME}, {TEXT})
$this->l11nManager->getHtml({LANGUAGE}, {MODULE}, {THEME}, {TEXT})
```
or indirectly by calling the `getText()` in the view context.
```
$this->getText({TEXT})
$this->getHtml({TEXT})
```
The language that should be used for a response should always be depending on the requested language and therefore never be hard coded.