3 declare(strict_types=1);
36 return $this->plugin_info->getPath() .
"/lang";
47 if (!@is_dir($directory)) {
53 $dir = opendir($directory);
54 while ($file = readdir($dir)) {
55 if ($file ===
"." || $file ===
"..") {
60 if (@is_file($directory .
"/" . $file) &&
61 strpos($file,
"ilias_") === 0 &&
62 substr($file, strlen($file) - 5) ===
".lang") {
64 "key" => substr($file, 6, 2),
81 $component =
$plugin->getComponent();
82 $slot =
$plugin->getPluginSlot();
84 return $component->getId() .
"_" . $slot->getId() .
"_" .
$plugin->getId();
94 ilGlobalCache::flushAll();
97 if (!isset($a_lang_keys)) {
100 if ($langObj->isInstalled()) {
101 $a_lang_keys[] = $langObj->getKey();
110 foreach ($langs as
$lang) {
112 if (!in_array($lang[
'key'], $a_lang_keys,
true)) {
123 if (is_array(
$txt)) {
124 foreach (
$txt as $row) {
125 if ($row[0] !==
"#" && strpos($row,
"#:#") > 0) {
126 $a = explode(
"#:#", trim($row));
127 $identifier = $prefix .
"_" . trim(
$a[0]);
128 $value = trim(
$a[1]);
130 if (isset($local_changes[$identifier])) {
131 $lang_array[$identifier] = $local_changes[$identifier];
133 $lang_array[$identifier] = $value;
141 ilObjLanguage::replaceLangModule($lang[
"key"], $prefix, $lang_array);
148 $ilDB = $DIC->database();
155 "DELETE FROM lng_data" .
156 " WHERE module = " .
$ilDB->quote($prefix,
"text")
159 "DELETE FROM lng_modules" .
160 " WHERE module = " .
$ilDB->quote($prefix,
"text")
171 $lng = $DIC->language();
173 if (is_object(
$lng)) {
181 public function txt(
string $a_var): string
184 $lng = $DIC->language();
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_var)
Get Language Variable (prefix will be prepended automatically)
static getInstalledLanguages()
Get the language objects of the installed languages.
__construct(ilPluginInfo $plugin_info)
getAvailableLangFiles()
Get array of all language files in the plugin.
updateLanguages(?array $a_lang_keys=null)
Simple value class for information about a plugin.
static replaceLangEntry(string $a_module, string $a_identifier, string $a_lang_key, string $a_value, string $a_local_change=null, string $a_remarks=null)
Replace lang entry.
loadLanguageModule()
Load language module for plugin.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
static _getLocalChangesByModule(string $a_key, string $a_module)
Get the local changes of a language module $a_key Language key $a_module Module key Return array iden...
ilPluginInfo $plugin_info