mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48:40 +00:00
Dynamic language loading
This commit is contained in:
parent
6c570fb63c
commit
e7a016cb07
|
|
@ -648,8 +648,6 @@ class ModuleManager
|
|||
{
|
||||
$this->running[$module] = ModuleFactory::getInstance($module, $this->app);
|
||||
$this->app->dispatcher->set($this->running[$module], '\Modules\\' . $module . '\\Controller');
|
||||
// todo: replace 'en' with request language.
|
||||
$this->loadLanguage($module, 'en');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -670,23 +668,4 @@ class ModuleManager
|
|||
|
||||
return $this->running[$module];
|
||||
}
|
||||
|
||||
/**
|
||||
* Load module language.
|
||||
*
|
||||
* @param string $module Module name
|
||||
* @param string $language Language
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @author Dennis Eichhorn
|
||||
*/
|
||||
public function loadLanguage(string $module, string $language)
|
||||
{
|
||||
$file = $this->running[$module]->getLocalization($language, $this->app->appName);
|
||||
if (!empty($file)) {
|
||||
$this->app->l11nManager->loadLanguage($language, $module, $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user