PrestaShop / PrestaShop

PrestaShop is the universal open-source software platform to build your e-commerce solution.
https://www.prestashop-project.org/
Other
8.15k stars 4.8k forks source link

Language codes incorrect, causing error with tiny_mce and other js in AdminProduct #13131

Open madsoliver opened 5 years ago

madsoliver commented 5 years ago

Describe the bug If we change the employee language to Traditional Chinese (TW) in BO, there have some error and the calendar windows cannot show up.

To Reproduce Steps to reproduce the behavior:

When we goto Products / Category in BO, it will show "Uncaught ReferenceError: file_not_found is not defined". And I checked in the server /js/tiny_mce/langs/tw.js, there is no tw.js file in there.

When we Edit the products in BO, it will show "Uncaught ReferenceError: file_not_found is not defined" and "Uncaught TypeError: locale() locale tw-tw is not loaded from moment locales!", then if we click the calendar icon to select the date (eg: add a specific price -> available from), the calendar cannot show up.

But If we change the employee profile to English again, all is working properly without any error. it seem there have some files is missing for TW-TW.

Same issues for Norwegian Bokmål (nb-NO).

Additionnal information PrestaShop version: 1.7.5.1 or any 1.7.5-version PHP version: any

Sollution:

  1. Change language-code from for example no-no to nb-no.
  2. Change name of /js/tinymce/langs/nb.js to /js/tinymce/langs/no.js
khouloudbelguith commented 5 years ago

Hi @onklmaps,

If you have already fixed it on your end or if you think you can do it, please do send us a pull request!

Thanks!

marionf commented 5 years ago

capture d'écran_1283

madsoliver commented 5 years ago

Why was this tagged as a minor issue? It breaks alot of javascript-dependent things in the product page! Try to edit combinations for example. It does not open the modals correctly. I guess a lot of other things as well (like any module in the product modules tab).

How to fix:

    • Change language-code from for example no-no to nb-no.
    • Change name of /js/tinymce/langs/nb.js to /js/tinymce/langs/no.js
matks commented 5 years ago

Why was this tagged as a minor issue?

Hi, I think it has been tagged a minor issue because it only happens for a specific configuration, not every language (using Chinese here) and it does not impact critical features of an e-commerce like checkout. It does not mean we don't care 😉 this is just a labeling system we use to put issues in categories.

If tomorrow a thief steals 200 dollars from you, maybe a policeman will tell you it's a minor loss because someone else was stolen 20,000 dollars. 200 dollars is still a lot for you but the policeman has to label the 2 losses 😉 .

madsoliver commented 5 years ago

Yeah.. This is more like a 2000 dollars standard issue ;-)

marionf commented 5 years ago

Reproduced with 1.7.6.0

capture d'écran_1526

ovallepa commented 5 years ago

Hello onklmaps. I have an error similar to the one you describe once I upgraded from prestashop 1.7.4.4 to 1.7.5.2. Now I have this error: cb.js:1 Uncaught ReferenceError: file_not_found is not defined at cb.js:1 My country is Colombia and by default corresponds (cb). According to your indications I tried to create cb.js from es.js, they are very similar in the code (as I change 'es' to 'cb') /js/tinymce/langs/es.js to /js/tinymce/langs/cb.js But it still does not work for me. Please, can you help me?

jenmobo commented 4 years ago

@ovallepa Pudiste solucionar el problema con el error me esta sucediendo lo mismo en este momento

ovallepa commented 4 years ago

@ovallepa Pudiste solucionar el problema con el error me esta sucediendo lo mismo en este momento

El problema se resolvió actualizando a 1.7.6.0

pinzon commented 4 years ago

Hello onklmaps. I have an error similar to the one you describe once I upgraded from prestashop 1.7.4.4 to 1.7.5.2. Now I have this error: cb.js:1 Uncaught ReferenceError: file_not_found is not defined at cb.js:1 My country is Colombia and by default corresponds (cb). According to your indications I tried to create cb.js from es.js, they are very similar in the code (as I change 'es' to 'cb') /js/tinymce/langs/es.js to /js/tinymce/langs/cb.js But it still does not work for me. Please, can you help me?

I have the same problem but instead of cb.js I need a mx.js

Captura de pantalla de 2020-09-09 19-39-50