Disable English fallback

This commit is contained in:
ruan 2021-01-07 21:12:44 +02:00
parent c2fdc318d0
commit 3e2d6286f3
2 changed files with 3 additions and 9 deletions

View File

@ -8,6 +8,6 @@ All translations in the "lang" folder have been contributed by users. Only the "
I do not update these files -- even if I fully understood all of these languages, unfortunately I would not have the time to update all of the translations on my own, especially with the growing number of translations.
As a result, in the future, these translations may contain untranslated English text until they are updated.
As a result, in the future, these translations may become outdated.
Pull requests are welcome if you want to fix any problems with user contributed translations.

View File

@ -14,14 +14,12 @@ class Page {
setlocale(LC_ALL, $settings->lang);
require_once './lang/en_US.utf8.php';
$this->defaultlang = new en_US();
require_once './lang/' . $settings->lang . '.php';
$lang_class = substr($settings->lang, 0, strpos($settings->lang, ".")); // grab "en_US" from "en_US.utf8"
if ($lang_class !== "en_US" && class_exists($lang_class)) {
$this->lang = new $lang_class;
} else {
$this->lang = $this->defaultlang;
$this->lang = new en_US();
}
$this->conn = $settings->conn;
@ -115,11 +113,7 @@ class Page {
if (array_key_exists($str, $this->lang->array)) {
return $this->lang->array[$str];
}
if (array_key_exists($str, $this->defaultlang->array)) {
return $this->defaultlang->array[$str];
}
// return "404";
return $str;
return "[$str]";
}
public function type_info($type) {