PrestaShop / PrestaShop

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

Back office JavaScript bug with Ukrainian translation for all modules PS 1.7-8.1 #32918

Open dnkhack opened 1 year ago

dnkhack commented 1 year ago

Prerequisites

Describe the bug and add attachments

If the back office uses the Ukrainian interface language few translation wording which has the symbol single quote does the issue on the configuration page in every module! Javascript crashed and some features for the module stop working!

This happens then PS adds JS variables to the page! To solve it I have to replace the single quote with the same symbol apostrophe. It is the best solution in this case! If I add a slash to escape the single quote symbol - JS works well but translation in the back office appears with a slash.

The highest problem is if the module adds JS values with the Media::addJsDef method. In this case, after JS crashed, all module's JS variables will not be declared!

The same happens if the module or module AdminController form has the date set input!

image

image

image

And the same issue for Friday at the Ukrainian. But I can reproduce that to show, cause I can find the module where it happened!

image

Expected behavior

Symbol single quota has to be escaped

Steps to reproduce

  1. Install fresh PS on any version from 1.7 to 8.1 (but I checked it only from 1.7.7 to 8.1)
  2. Add the Ukraine language.
  3. Chang for employer lang for the back office to Ukrainian
  4. Go to the Module page
  5. Open the configuration page of any module with opened development browser tool
  6. Go to the page Console on the Development browser tool

PrestaShop version(s) where the bug happened

1.7.7-8.1

PHP version(s) where the bug happened

7.3-7.4

If your bug is related to a module, specify its name and its version

all modules with non Simfony configuration interface

Your company or customer's name goes here (if applicable).

DNK Soft

AureRita commented 1 year ago

Hi @dnkhack

Thank you for your report, I tried to reproduce you issue but as you can see I didn't reproduce it :

Untitled_ Jun 16, 2023 4_41 PM.webm

Did I miss something ?

Waiting for your feedback

dnkhack commented 1 year ago

@AureRita Hello, please be mindful. You have missed item 3 in the list of steps to reproduce.

Have a good one :)

aniszr commented 1 year ago

Hello, I succeded to reproduce your issue with PS 8.0.4.

See attached screenrecord:

https://github.com/PrestaShop/PrestaShop/assets/92626242/2fec58e6-5ab1-4ad2-ac91-1db3497c14c8

Thanks!

kpodemski commented 1 year ago

Hello,

Ukrainian translation has to be updated on Crowdin it seems.

CC @l-delin

l-delin commented 1 year ago

Hello @dnkhack, I've edited the following strings, so these should be fixed:

Is there any other string that behaves the same way? If you have a list, I'd gladly edit them all for you :-)

Thank you!

dnkhack commented 1 year ago

@l-delin hello. Thank you for your good job. If I notice this kind of issue I'll notify you. Have a good one :)

dnkhack commented 1 year ago

@l-delin Hello, the problem is still here. I think you have wrong understand me. Issue not in translation. The issue in core code. Please, pay attention to the issue description. Thank you in advance :)

kpodemski commented 1 year ago

@dnkhack don't you have any other phrase possible to use that doesn't use '? of course it could be done via core, but it works like that for many years ;-)

dnkhack commented 1 year ago

@kpodemski Hi there. I can explain it. Please be mindful when reading me.

  1. I'm from Ukraine. Before the war started the whole country used to speak on Russian language. Imaging it. In conversations, movies, books, sites, and newspapers - 95% used Russian.
  2. After the law that restricted the Russian language merchants still use Russian for back office
  3. Prestashop doesn't have popularity in Ukraine. I desire to change it :) Reason is. For instance, the main(general) Carrier of Ukraine is not present on PS Addons. I fixed it! The second Carrier -module that exists on PS Addons is a shame. Same here, fixed! The first banking of Ukraine Mono Bank is not present too! In working. Famed Ukranian Fondy.ua acquiring is not present too, and the free module on GitHub doesn't work for 2 years. They asked me for help, and I have finished that recently.
  4. I'm a newbie Prestashop programmer. My first meeting with PS started with a "pet volunteer" project. It is a multivendor marketplace. It was like that:
    • oh. Why I can't save the product with the combination? Mmm - Debug mode is on.
    • why is a module after setting the date in the date field stopped working? Cause Friday (П'ятниця)! Valid only for the native framework.
    • why is after precision less than 0,00001 some modules stop working? Cause floating point numbers are shown in an exponential form that precision. $a = 0.000022 echo $a // 2.2E-5. And RegExp in Validate::isPrice returns false. Raritet bug!

After I have fixed all those issues I became the PS developer. Really it is love from the first bug fix. And now all attention spending on PS a module coding. Personally to me, all that is an advantage, because ordinary customers in my country are not able to make e-shop by themselves. They require Prestashop expert assistance.

However, you can leave off that advantage to me. Don't fix it :) But I believe it is not good for a perfect PS framework.

Have a good one.