mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-12 19:13:57 +02:00
i18n: Add english as always available, and merge other languages in case of missing keys
Signed-off-by: Marco Dickert <marco@misterunknown.de>
This commit is contained in:
@@ -38,6 +38,10 @@ foreach ($options as $key => $value)
|
|||||||
$langs = array_merge($langs, explode(",", $value));
|
$langs = array_merge($langs, explode(",", $value));
|
||||||
$langs = array_unique($langs);
|
$langs = array_unique($langs);
|
||||||
$vars['default_lang'] = ($langs[0] == "all") ? "en" : $langs[0];
|
$vars['default_lang'] = ($langs[0] == "all") ? "en" : $langs[0];
|
||||||
|
// ensure english is available, as it gets merged with the other languages
|
||||||
|
// in case of missing keys in other languages.
|
||||||
|
if (!in_array("all", $langs) || !in_array("en", $langs))
|
||||||
|
array_push($langs, "en");
|
||||||
|
|
||||||
if (in_array("all", $langs))
|
if (in_array("all", $langs))
|
||||||
$langs = array_map(
|
$langs = array_map(
|
||||||
|
3
docker/php.ini
Normal file
3
docker/php.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
max_execution_time = 0
|
||||||
|
upload_max_filesize = 0
|
||||||
|
post_max_size = 0
|
@@ -184,9 +184,10 @@ f00bar;
|
|||||||
$this->i18n = $i18n;
|
$this->i18n = $i18n;
|
||||||
|
|
||||||
if( in_array( $this->config['language'], array_keys( $this->i18n ) ) )
|
if( in_array( $this->config['language'], array_keys( $this->i18n ) ) )
|
||||||
$this->l = $this->i18n[$this->config['language']];
|
// Merge english with the language in case of missing keys
|
||||||
|
$this->l = (object)array_merge((array)$this->i18n['en'], (array)$this->i18n[$this->config['language']]);
|
||||||
else
|
else
|
||||||
$this->l = reset($this->i18n);
|
$this->l = $this->i18n['en'];
|
||||||
|
|
||||||
if ($this->config['timezone'])
|
if ($this->config['timezone'])
|
||||||
date_default_timezone_set($this->config['timezone']);
|
date_default_timezone_set($this->config['timezone']);
|
||||||
|
Reference in New Issue
Block a user