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.
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'] = ',';
Answer
here are the steps I would take to troubleshoot this issue:
check the language settings in admin -> system -> localization -> language. this is how it should look http://joxi.ru/eAOYwZkU9EDEDm
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
then check the opencart language editor at admin -> design -> language editor. should look like this http://joxi.ru/E2p1aYlS7VxVEA
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
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)
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
- 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
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
- 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
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.
- If none of this helps, send us a ticket at https://dreamvention.ee/support and I will personally take a look.
Hope this helps.
Related Questions
- → How to remove category name from url in opencart 2.x?
- → How To add slash between seo friendly url in opencart
- → OpenCart throws JS error 'Cannot read property "document" of null' when hosted
- → opencart seo friendly url only works for some pages
- → Seo url doens't work with homepage in OpenCart 3
- → Migrating opencart 1.5.6 to 3.0.2.0 will affect seo?
- → How do I create an SEO-friendly link for custom, dynamically generated pages in Opencart?
- → Which is the best way for data migration from Shopify to Opencart 3.0.3.1 using CSV files or using API?
- → Price range filter in opencart
- → Open Cart SEO URL for category/manufacturer
- → Remove HTML Attributes and tags
- → Clean URL's using OpenCart's router class
- → How to create notification dialog that can appear bottom of the screen in opencart portal