Hello guys !
I made a stupid thing , i tried to make "Romanian" default language , but i changed the en-gb folder to ro-ro (Catalog and Administrator) , and then from administrator -> Localisation -> Languages ... from en-gb to ro-ro without adding separately ro-ro and let english there .
Now my problem is next.. i have no more products , customers available , no more customers groups, order statuses , return statuses and many others .
I think that admin panel read the language as "non set" .. "undefined language" and my buttons are like text_home , text_option , text_ ...
I put the public_html backup from yesterday , but nothing changed , i tried to make English language as default from Settings -> Local , but i can't save because there are no "Order status" available and i can't add any order status .. http://ibb.co/g2jYOw this is from Settings-> Option when i try to save English default .
I checked the database , Customers , order status , everything is there and fine .. how can i make the admin panel read english as default again and not undefined language ?
I made a stupid thing , i tried to make "Romanian" default language , but i changed the en-gb folder to ro-ro (Catalog and Administrator) , and then from administrator -> Localisation -> Languages ... from en-gb to ro-ro without adding separately ro-ro and let english there .
Now my problem is next.. i have no more products , customers available , no more customers groups, order statuses , return statuses and many others .
I think that admin panel read the language as "non set" .. "undefined language" and my buttons are like text_home , text_option , text_ ...
I put the public_html backup from yesterday , but nothing changed , i tried to make English language as default from Settings -> Local , but i can't save because there are no "Order status" available and i can't add any order status .. http://ibb.co/g2jYOw this is from Settings-> Option when i try to save English default .
I checked the database , Customers , order status , everything is there and fine .. how can i make the admin panel read english as default again and not undefined language ?
hi,
just put again the en-gb language folders
and check the oc_language table
just put again the en-gb language folders
and check the oc_language table
Opencart Developer - For custom work and support contact @ webcorvo@gmail.com
hi Dnk32
Did you have already solved your language problem?
Did you have already solved your language problem?
Opencart Developer - For custom work and support contact @ webcorvo@gmail.com
I don't know why these types of modifications are even being allowed but when a language code does not exist as a folder, it should definitely be validated from the post.
In admin/controller/localisation/language.php file,
find:
replace with:
Then, find:
replace with:
In admin/language/<your_language_code>/localisation/language.php file,
find:
replace with:
In admin/view/template/localisation/language.twig file,
find:
replace with:
This will prevent administrators making the same mistake when changing the language code into a non-relevant or non-existing language code that would create corruption of the data relationship in the database.
In admin/controller/localisation/language.php file,
find:
Code: Select all
foreach ($results as $result) {
$data['languages'][] = array(
'language_id' => $result['language_id'],
'name' => $result['name'] . (($result['code'] == $this->config->get('config_language')) ? $this->language->get('text_default') : null),
'code' => $result['code'],
'sort_order' => $result['sort_order'],
'edit' => $this->url->link('localisation/language/edit', 'user_token=' . $this->session->data['user_token'] . '&language_id=' . $result['language_id'] . $url, true)
);
}
Code: Select all
$data['language_codes'] = array();
foreach ($results as $result) {
$data['languages'][] = array(
'language_id' => $result['language_id'],
'name' => $result['name'] . (($result['code'] == $this->config->get('config_language')) ? $this->language->get('text_default') : null),
'code' => $result['code'],
'sort_order' => $result['sort_order'],
'edit' => $this->url->link('localisation/language/edit', 'user_token=' . $this->session->data['user_token'] . '&language_id=' . $result['language_id'] . $url, true)
);
$data['language_codes'][] = array('code' => html_entity_decode($result['code'], ENT_QUOTES, 'UTF-8'));
}
Code: Select all
if (utf8_strlen($this->request->post['code']) < 2) {
Code: Select all
if (utf8_strlen($this->request->post['code']) < 2 || !in_array($this->request->post['code'], $this->request->post['language_codes'])) {
find:
Code: Select all
$_['error_code'] = 'Language Code must at least 2 characters!';
Code: Select all
$_['error_code'] = 'Language Code must at least 2 characters as it must be an existing language code installed in the store!';
find:
Code: Select all
<td class="text-left">{{ language.code }}</td>
Code: Select all
<td class="text-left">
{% if language_codes %}
{% for language_code in language_codes %}
<input type="hidden" name="language_codes[]" value="{{ language_code.code }}">
{% endfor %}
{% endif %}
{{ language.code }}</td>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hello,
I had the same problem, and I cried for 5 hours until I found a solution.
Open (phpmyadmin) and go to 'settings' table, then search for 'config_admin_language' and set the value to en-gb.
I had the same problem, and I cried for 5 hours until I found a solution.
Open (phpmyadmin) and go to 'settings' table, then search for 'config_admin_language' and set the value to en-gb.
Who is online
Users browsing this forum: No registered users and 219 guests