$ Currency

Language switching does not work in the OpenCart 4.0.2.2 admin panel

Recently, on July 9, 2023, another OpenCart 4.0.2.2 release came out, and once again with a whole bunch of issues, unfinished work, bugs, etc. Perhaps there is some intent of the author that no one kn…

Language switching does not work in the OpenCart 4.0.2.2 admin panel

Recently, on July 9, 2023, another OpenCart 4.0.2.2 release came out, and once again with a whole bunch of issues, unfinished work, bugs, etc. Perhaps there is some intent of the author that no one knows about, but everyone is starting to get used to the fact that no good can be expected from a new version release. So this time, a half-working build was released without any notes that it is not worth using for developing real online stores. After all, it is only suitable for learning and finding bugs.

One of the issues in OpenCart 4.0.2.2 is that you cannot change the language in the administrator panel. This has been a problem of the entire branch starting from 4.0.0.0; six releases have already been published, yet the language still cannot be changed. On the author's official GitHub, he has been flooded with "issues" and "pull requests" about this bug, but every time he closes the request, he says that no such problem exists. Of course, for single-language sites such a problem does not exist :)


So, what is the solution? It is simple, just two edits. Thanks to one of the system's contributors, we have hope that in the new release this issue will be gone for good, since the fix commit has already been "merged" into the official OpenCart repository.

We will explain what needs to be edited and where, so that the language in the OpenCart 4.0.2.2 admin panel switches without issues:


1. File /admin/controller/startup/language.php

Find the line

$code = $this->config->get('config_language');

and replace it with

$code = $this->config->get('config_language_admin');


2. File /system/config/admin.php

Find the line:

'view/*/before' => [

and before it add the code

'language/*/after' => [
    0 => 'startup/language.after',
    1 => 'event/translation'
],


That is such a simple solution. We are looking forward to a stable OpenCart 4 release and are ready to develop custom extensions for your online stores on the "fourth branch".

Last updated: 19.04.2026

Contact via Telegram Contact via Telegram