mirror of
https://gitlab.com/ruany/litebans-php.git
synced 2025-05-23 00:19:05 +00:00
Disable English fallback
This commit is contained in:
parent
c2fdc318d0
commit
3e2d6286f3
@ -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.
|
||||
|
10
inc/page.php
10
inc/page.php
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user