aboutsummaryrefslogtreecommitdiff
path: root/Neutron-trunk/api/lang/processor.php
diff options
context:
space:
mode:
authorGitea <gitea@fake.local>2021-11-10 17:53:13 +0100
committerGitea <gitea@fake.local>2021-11-10 17:53:13 +0100
commit7b4af63a90a726b98a59b83e53f040a7a566a11d (patch)
treeb85747947816fe4375e85ab6b822ffabec548c7b /Neutron-trunk/api/lang/processor.php
parent80f78c2925530e945503ab603e79d1acc53075f4 (diff)
downloadelectrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.gz
electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.tar.bz2
electrode-7b4af63a90a726b98a59b83e53f040a7a566a11d.zip
Update
Diffstat (limited to 'Neutron-trunk/api/lang/processor.php')
-rw-r--r--[-rwxr-xr-x]Neutron-trunk/api/lang/processor.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/Neutron-trunk/api/lang/processor.php b/Neutron-trunk/api/lang/processor.php
index 8ab2e99..d9c9566 100755..100644
--- a/Neutron-trunk/api/lang/processor.php
+++ b/Neutron-trunk/api/lang/processor.php
@@ -27,9 +27,10 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/" . $langsel)) {
}
}
} else {
- if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/fr")) {
+ $langsel = "en";
+ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/en")) {
echo("Unable to load language files: unable to find selected language files, loading fallback files");
- $langprops = scandir($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/fr/");
+ $langprops = scandir($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/en/");
foreach ($langprops as $langprop) {
if ($langprop != "." && $langprop != "..") {
$langpieces = explode("/", implode("/", explode("\\", $langprop)));
@@ -38,9 +39,9 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/" . $langsel)) {
if ($langitemsel[count($langitemsel) - 1] != "json") {
require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unable to load language file: " . implode(".", $langitemsel) . " is not in a valid format. Language files must be JSON.");
} else {
- json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/fr/" . $langprop), true);
+ json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/en/" . $langprop), true);
if (json_last_error() == JSON_ERROR_NONE) {
- $lang[$langitemsel[count($langitemsel) - 2]] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/fr/" . $langprop), true);
+ $lang[$langitemsel[count($langitemsel) - 2]] = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/resources/i18n/en/" . $langprop), true);
} else {
require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unable to load language file: " . implode(".", $langitemsel) . " isn't a valid JSON file. Please check for syntax errors and retry.");
}