49 $lang_array = array();
50 $lang_array[
"common"] = array();
54 $query =
"INSERT INTO lng_data (module,identifier,lang_key,value,local_change,remarks) VALUES ";
55 foreach ($this->content as $val) {
61 $separated = explode($this->separator, trim($val));
62 $pos = strpos($separated[2], $this->comment_separator);
64 $separated[3] = substr($separated[2], $pos + strlen($this->comment_separator));
65 $separated[2] = substr($separated[2], 0, $pos);
69 $local_value = $this->local_changes[$separated[0]][$separated[1]] ??
"";
71 if (empty($this->scope)) {
73 if ($local_value !==
"" && $local_value !== $separated[2]) {
75 $lang_array[$separated[0]][$separated[1]] = $local_value;
78 } elseif ($this->scope ===
"local") {
80 if ($local_value !==
"") {
82 $lang_array[$separated[0]][$separated[1]] = $local_value;
86 if ($double_checker[$separated[0]][$separated[1]][$this->key] ??
false) {
88 $DIC->ui()->mainTemplate()->setOnScreenMessage(
90 "Duplicate Language Entry in $lang_file:\n$val",
92 $DIC->ctrl()->redirectByClass(ilobjlanguagefoldergui::class,
'view');
94 $double_checker[$separated[0]][$separated[1]][
$this->key] =
true;
97 "(%s,%s,%s,%s,%s,%s),",
98 $this->ilDB->quote($separated[0],
"text"),
99 $this->ilDB->quote($separated[1],
"text"),
100 $this->ilDB->quote($this->key,
"text"),
101 $this->ilDB->quote($separated[2],
"text"),
102 $this->ilDB->quote($this->change_date,
"timestamp"),
103 $this->ilDB->quote($separated[3] ?? null,
"text")
106 $lang_array[$separated[0]][$separated[1]] = $separated[2];
108 $query = rtrim(
$query,
",") .
" ON DUPLICATE KEY UPDATE value=VALUES(value),local_change=VALUES(local_change),remarks=VALUES(remarks);";
110 $this->ilDB->manipulate(
$query);