mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 06:36:06 +03:00
language loading fix
This commit is contained in:
parent
ec022db8b5
commit
7cceb9852c
@ -113,15 +113,21 @@ $registry->set('cache', $cache);
|
|||||||
$registry->set('response', $response);
|
$registry->set('response', $response);
|
||||||
$session = new Session();
|
$session = new Session();
|
||||||
$registry->set('session', $session);
|
$registry->set('session', $session);
|
||||||
$languages = array();
|
|
||||||
|
|
||||||
|
$languages = array();
|
||||||
$query = $db->query("SELECT * FROM " . DB_PREFIX . "language");
|
$query = $db->query("SELECT * FROM " . DB_PREFIX . "language");
|
||||||
foreach ($query->rows as $result) {
|
foreach ($query->rows as $result) {
|
||||||
$languages[$result['code']] = $result;
|
$languages[$result['code']] = $result;
|
||||||
}
|
}
|
||||||
$config->set('config_language_id', $languages[$config->get('config_admin_language')]['language_id']);
|
|
||||||
$language = new Language($languages[$config->get('config_admin_language')]['directory']);
|
$adminLanguageCode = $config->get('config_admin_language');
|
||||||
$language->load($languages[$config->get('config_admin_language')]['filename']);
|
$config->set('config_language_id', $languages[$adminLanguageCode]['language_id']);
|
||||||
|
$language = new Language($languages[$adminLanguageCode]['directory']);
|
||||||
|
if(isset($languages[$adminLanguageCode]['filename'])) {
|
||||||
|
$language->load($languages[$adminLanguageCode]['filename']);
|
||||||
|
} else {
|
||||||
|
$language->load($languages[$adminLanguageCode]['directory']);
|
||||||
|
}
|
||||||
$registry->set('language', $language);
|
$registry->set('language', $language);
|
||||||
|
|
||||||
$document = new Document();
|
$document = new Document();
|
||||||
|
Loading…
Reference in New Issue
Block a user