Page 1 of 1

The language file could not be loaded correctly.

Posted: Thu May 11, 2023 1:36 pm
by HAO
I translate the language files myself, I made sure I translate my language file the way it is in English.

I also made sure my language id is set to 2, And the MySQL language content I translated can be displayed normally.

OpenCart 4.0.2.1
Image

Image

Image

Image

But why can't I load my language file directory correctly?

My language file directory and file name, I hope to be: zh-tw.

How can I solve this problem?

Can someone help me?

Thank you!

Re: The language file could not be loaded correctly.

Posted: Thu May 11, 2023 8:09 pm
by straightlight
OC version. Language switching issue has already been reported on the Github Opencart repository.

Re: The language file could not be loaded correctly.

Posted: Thu May 11, 2023 9:16 pm
by HAO
So you mean it has nothing to do with my translation, it's a problem with this version itself?

If so, why does this version simply remove the MySQL fields for the directory name?

I think the old way works fine.

Re: The language file could not be loaded correctly.

Posted: Thu May 11, 2023 9:32 pm
by by mona
OC4 is not suitable for production sites (assuming that you posted in the correct forum)
If your purpose is to report the bug without the specific OC version it is likley to be ignored.

Please follow the forum rules before posting.
Minimum requirement is OC version / themes and any relevant extensions.

Re: The language file could not be loaded correctly.

Posted: Thu May 11, 2023 10:52 pm
by HAO
Doesn't the screenshot I provided explain it?
OpenCart 4.0.2.1

I'm working on a translation, I just want to confirm my translation.

I don't intend to officially run this site.

Re: The language file could not be loaded correctly.

Posted: Thu May 11, 2023 11:50 pm
by by mona
HAO wrote:
Thu May 11, 2023 10:52 pm
Doesn't the screenshot I provided explain it?
OpenCart 4.0.2.1

I'm working on a translation, I just want to confirm my translation.

I don't intend to officially run this site.
Well the screenshots were not there when you asked ::)
Thank you for adding a OC version.

I am sure this will be added at some point to the long list of things to be fixed.
In the meantime the community will be most grateful if you come back with any fix you come up with .. then the list will get shorter :)


In order to point you in the right direction
https://www.opencart.com/index.php?rout ... n_id=44060
https://www.opencart.com/index.php?rout ... egory_id=2
and
https://github.com/opencart/opencart/issues/12290

Re: The language file could not be loaded correctly.

Posted: Fri May 12, 2023 12:47 am
by HAO
HAO wrote:
Thu May 11, 2023 10:52 pm
Doesn't the screenshot I provided explain it?
OpenCart 4.0.2.1

I'm working on a translation, I just want to confirm my translation.

I don't intend to officially run this site.
Well the screenshots were not there when you asked ::)
Thank you for adding a OC version.

I am sure this will be added at some point to the long list of things to be fixed.
In the meantime the community will be most grateful if you come back with any fix you come up with .. then the list will get shorter :)


In order to point you in the right direction
https://www.opencart.com/index.php?rout ... n_id=44060
https://www.opencart.com/index.php?rout ... egory_id=2
and
https://github.com/opencart/opencart/issues/12290
I just wrap the screenshots in the post using hyperlinks.

Because the default BBCode image of phpBB contains hyperlinked BBCode is too complicated. (Didn't you notice it then?)

Anyway I follow this link to modify the file and it still doesn't work, and I have my flag image file, but it doesn't show up.
https://github.com/opencart/opencart/issues/12290

Re: The language file could not be loaded correctly.

Posted: Fri May 12, 2023 1:43 am
by by mona
ok - let us know if you find a solution

Re: The language file could not be loaded correctly.

Posted: Sat May 13, 2023 2:43 am
by xxvirusxx
Make this changes admin and catalog side, but for catalog change admin with catalog (line 23)

https://github.com/opencartbot/opencart ... 3407649ea4
https://github.com/opencart/opencart/is ... 1437666647

As per file use default.php instead of zh-tw.php

Re: The language file could not be loaded correctly.

Posted: Mon May 15, 2023 1:43 am
by HAO
xxvirusxx wrote:
Sat May 13, 2023 2:43 am
Make this changes admin and catalog side, but for catalog change admin with catalog (line 23)

https://github.com/opencartbot/opencart ... 3407649ea4
https://github.com/opencart/opencart/is ... 1437666647

As per file use default.php instead of zh-tw.php
Okay, I have followed your modification steps to solve the problem.

The same steps are also modified in the catalog directory:

Code: Select all

				$this->language->addPath(DIR_EXTENSION . $language_info['extension'] . '/catalog/language/');
			} else {
				$this->language->addPath(DIR_LANGUAGE);
			}
Thanks again for your help!

PS. The button text during installation cannot be displayed.

Because I am a complete translation of MySQL default data, So there are two languages after installation.

So anyone want to fix the button problem to load this file:
upload/install/language/zh-tw/default.php

Please continue the discussion.

Re: The language file could not be loaded correctly.

Posted: Mon May 15, 2023 7:38 pm
by by mona
+1

Re: The language file could not be loaded correctly.

Posted: Tue May 16, 2023 3:19 am
by xxvirusxx
HAO wrote:
Mon May 15, 2023 1:43 am
PS. The button text during installation cannot be displayed.
I didn't tested/or made translation for install...because I was not interested....

So just wait....
I made my own translation but because of opencart bugs...was not published on Marketplace.....and 90% possible will not be published...and will remain on my private repo, but maybe after 2-3 years I will used :laugh:

LE: Start to think to switch to Magento :)