19declare(strict_types=1);
33 private const LANG_PHP =
'lang.php';
37 $dic->language()->loadLanguageModule(
'gsfo');
40 public function translate(
string $identifier, ?
string $prefix =
null): string
42 $key = $prefix !==
null ? $prefix .
'_' . $identifier : $identifier;
44 return $this->dic->language()->txt($key);
47 private function internal(
string $translation):
string
49 if ($translation ===
'-' . $key .
'-') {
50 $file = __DIR__ .
'/' . self::LANG_PHP;
52 $current = (array) ((@include $file) ?? []);
53 if (!isset($current[$key])) {
54 $current[$key] = $key;
55 file_put_contents($file,
'<?php return ' . var_export($current,
true) .
';');
57 $translation = $current[$key];
Customizing of pimple-DIC for ILIAS.
__construct()
Constructor setup ILIAS global object @access public.