- //Iterate on keys to translate
- foreach($this->config['translate'] as $translate) {
- //Extract keys
- $keys = explode('.', $translate);
-
- //Set current
- $current =& $context;
-
- //Iterate on each subkey
- do {
- //Skip unset translation keys
- if (!isset($current[current($keys)])) {
- continue(2);
- }
-
- //Set current to subkey
- $current =& $current[current($keys)];
- } while(next($keys));
-
- //Set translation
- $current = $this->translator->trans($current, [], $this->alias);
-
- //Remove reference
- unset($current);
- }
-