mirror of
https://github.com/Karaka-Management/Developer-Guide.git
synced 2026-01-14 13:38:40 +00:00
Language call fix
This commit is contained in:
parent
766d5040b3
commit
4f165660cd
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user