Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | function smarty_function_translation($params) |
||
10 | { |
||
11 | global $opt; |
||
12 | |||
13 | if (!isset($params['key'])) { |
||
14 | return ''; |
||
15 | } |
||
16 | |||
17 | $translation = AppKernel::Container()->get(OcLegacy\Translation\TranslationService::class); |
||
18 | $translation->setLocale(strtolower($opt['template']['locale'])); |
||
19 | |||
20 | return $translation->trans($params['key']); |
||
21 | } |
||
22 |