mirror of
https://github.com/misterunknown/ifm.git
synced 2025-03-13 16:00:50 +01: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:
parent
6bbd02339b
commit
e014781af4
@ -38,6 +38,10 @@ foreach ($options as $key => $value)
|
||||
$langs = array_merge($langs, explode(",", $value));
|
||||
$langs = array_unique($langs);
|
||||
$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))
|
||||
$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;
|
||||
|
||||
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
|
||||
$this->l = reset($this->i18n);
|
||||
$this->l = $this->i18n['en'];
|
||||
|
||||
if ($this->config['timezone'])
|
||||
date_default_timezone_set($this->config['timezone']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user