user4327290
user4327290

Reputation:

how to fix if en-gb.php language file not working in only admin

I have problem in Opencart 3.0.2.0 in all language file showing their text and variable in page and working perfectly in admin except en-gb.php. Please see below image. enter image description here

I have try to debug but couldn't fix it.I also checked "storage" modification file to see if any file overwritten but it is same code all place.

you can see this code below already written in en-gb.php but its variable value not showing in any page of admin.

$_['code']                          = 'en';
$_['direction']                     = 'ltr';
$_['date_format_short']             = 'd/m/Y';
$_['date_format_long']              = 'l dS F Y';
$_['time_format']                   = 'h:i:s A';
$_['datetime_format']               = 'd/m/Y H:i:s';
$_['decimal_point']                 = '.';
$_['thousand_point']                = ',';

Upvotes: 1

Views: 1245

Answers (1)

Dmitriy Zhuk
Dmitriy Zhuk

Reputation: 767

here are the steps I would take to troubleshoot this issue:

  1. check the language settings in admin -> system -> localization -> language. this is how it should look http://joxi.ru/eAOYwZkU9EDEDm enter image description here

  2. check the opencart store settings in admin -> system -> settings -> edit your store and visit tab local. is should look like this http://joxi.ru/nAyxya7FgGbGv2 enter image description here

  3. then check the opencart language editor at admin -> design -> language editor. should look like this http://joxi.ru/E2p1aYlS7VxVEA enter image description here

  4. if all is correct there, lets check the code. in admin/language/en-gb/en-gb.php. should look like this http://joxi.ru/V2VLwxqSdVqVyr enter image description here

  5. then check if there are any modifications to the language file at system/storage/modifications/admin/language/en-gb/en-gb.php (the file should not exist)

  6. if you have vqmod installed, I would also check the cache in vqmod/vqcache/...

if all of this is correct, we need to dig deeper into the core of OpenCart

  1. the language file eb-gb (which is also the name of the language directory) in admin is loaded by the controller admin/startup/startup.php on line 27
$language->load($this->config->get('config_admin_language'));

so you can start by checking this code by returning the value after it like this:

$language->load($this->config->get('config_admin_language'));
//this will output everything that is currently in the languge ibject.
print_r($language);

it should look like this http://joxi.ru/l2ZRw70szkLLl2 enter image description here

If it doesn't return an array, the issue could be that this code is not loaded properly OR that the result is somewhere overwritten by an empty array.

If your store has modifications, you will need to check the system/storage/modifications and search for any code that could be doing something similar

  1. if that is correct, there is one more place to check. in admin/event/language.php you may have some issues. add this code on line 9
public function index(&$route, &$args) {
    foreach ($this->language->all() as $key => $value) {
        if (!isset($args[$key])) {
            $args[$key] = $value;
        }
    }
    // this will output the current values of the language object with the route name.
    echo $route;
    echo '<pre>';
    print_r($args);
    echo '</pre>'; 
}

it should look like this http://joxi.ru/DmBL9V6SJPWjWA enter image description here

if at some point after a specific route like common/footer you see that the text_home is empty or missing, then you need to check that route and its modifications and see what happened there.

  1. If none of this helps, send us a ticket at https://dreamvention.ee/support and I will personally take a look.

Hope this helps.

Upvotes: 1

Related Questions