New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed $legacyKey in buildTranslationCatalogueFromLegacyFiles() #33807
Conversation
Fixed $legacyKey to correctly match translations for original strings containing single quotes.
Hi, thanks for this contribution! I found some issues with the Pull Request description:
Would you mind having a look at it? This will help us understand how interesting your contribution is, thank you very much! About linked issuesPlease consider opening an issue before submitting a Pull Request:
(Note: this is an automated message, but answering it will reach a real human) |
It has to be tested by a developer. cc @PrestaShop/committers |
Hello @Amazzing. Could you send us a module example? |
@nicosomb you can use https://github.com/PrestaShop/vatnumber or any other module that uses legacy translations... |
@Amazzing hello, could you provide more details for the "how to test" part? Is there an example module available? (Other than https://github.com/PrestaShop/vatnumber, which is archived and contains nothing in /translations) |
@Amazzing What would be really really useful would be a list of accurate steps to reproduce the problem. Example:
😉 |
Actually, exact steps are listed in “How to test”. To make it clear - the problem is not about displaying translations in FO/BO, but about the result returned by Currently the display of legacy module translations is controlled by You can follow those steps for better understanding:
|
@Amazzing Thank you for the test module as well as the additional explanations. I tested it with and without the fix, it is good for me. Thanks for the contribution 😃 |
thanks @Amazzing! well done 👏🏻 |
Fixed
$legacyKey
to correctly match translations for original strings containing single quotes.buildTranslationCatalogueFromLegacyFiles()
. It happens because of incorrectly hashed$legacyKey
. This fix ensures that$legacyKey
is hashed correctly, same as inTranslate::getModuleTranslation()
2. Find a translatable text that has a single quote in it. For example
$this->l('Don\'t forget to clear cache')
3. Translate that text to FR or any other language, so translation is saved in
/fr.php
. It doesn't matter if translation has single quotes or not4. Check output:
$container->get('prestashop.translation.external_module_provider')->setModuleName($module_name)->setLocale($locale)->getMessageCatalogue();