more language migrations

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-29 10:01:58 +02:00
parent 0dc77997fe
commit 6116dda9bb
13 changed files with 37 additions and 102 deletions

View File

@@ -113,13 +113,12 @@ class ConfigDaemon
if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) {
return Settings::Get($match[1]);
} elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) {
global $lng;
if (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '' && isset($match[3]) && $match[3] != '') {
return $lng[$match[1]][$match[2]][$match[3]];
return lng($match[1] . '.' . $match[2] . '.' . $match[3]);
} elseif (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '') {
return $lng[$match[1]][$match[2]];
return lng($match[1] . '.' . $match[2]);
} elseif (isset($match[1]) && $match[1] != '') {
return $lng[$match[1]];
return lng($match[1]);
}
return '';
} elseif (preg_match('/^const\.(.*)$/', $matches[1], $match)) {
@@ -196,7 +195,7 @@ class ConfigDaemon
$preparsed[] = $include;
}
break;
// The next 3 are groupings, <visibility> MUST come first in this to work properly
// The next 3 are groupings, <visibility> MUST come first in this to work properly
case "commands":
case "files":
case "installs":

View File

@@ -93,13 +93,12 @@ class ConfigService
if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) {
return Settings::Get($match[1]);
} elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) {
global $lng;
if (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '' && isset($match[3]) && $match[3] != '') {
return $lng[$match[1]][$match[2]][$match[3]];
return lng($match[1] . '.' . $match[2] . '.' . $match[3]);
} elseif (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '') {
return $lng[$match[1]][$match[2]];
return lng($match[1] . '.' . $match[2]);
} elseif (isset($match[1]) && $match[1] != '') {
return $lng[$match[1]];
return lng($match[1]);
}
return '';
}