-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fix translations #15623
Fix translations #15623
Conversation
@cherednichenkoa Yes, JS will not translate phrases that don't exist in CSV file, but after command |
@VladimirZaets , I am debugging it now |
@VladimirZaets I quick went thru debugger , and here is what I have found Take a look at this file - this cli command uses it to parse html templates (it is our case) This is preg match used to parse .html templates for translation, as you can see, it does not cover all cases that magento uses on frontend translates ` Here is list of patters that magento uses to build js-tranlations.json for frontend , as you may see it has more types of translates it covers I think it is problem with different flow for this command and Magento js-translations.json logic,we can add more pattens thru di.xml to this parser, what do you think ? I will double check it later, that what I have found now, hope it will help you |
@cherednichenkoa I think they have a different responsibility, before adding new patterns we should fully understand of use cases. |
@VladimirZaets okay, you are trying to test my change with this console command, I have checked why it works so, what are the our further steps ? Not sure that I am clear what is wrong for now |
@cherednichenkoa I will merge your PR. The fix looks fine. Also, I will investigate the reason why CLI command works incorrectly. |
@VladimirZaets , ok got it, I will check it for sure |
Hi @cherednichenkoa. Thank you for your contribution. |
Fix unsupported translate tags in mini cart content
Description
Minicart template has several usages of
<tranlsate />
tags , however according to thisConfig (that has inside defined preg expressions for translator template parser)
Magento supports such definition of translate attribute
<span translate="'Text to translate'">
but not the tag ,this tag will be translated without problem on frontend, if such translation has additiona properl definitions
When magento initialize translations for FE, and put it in Magento\Translation\Model\Js\Config::DICTIONARY_FILE_NAME file , it parses templates to get proper set of translations, in case template has definition, it will not match preg's, so it will not be translated on frontend
Fixed Issues (if relevant)
Magento has around 20 definitions of
<template />
tag, so it does not make sense to add additional preg to create additional load for template parser, only for 20 templatesManual testing scenarios
<translate />
" tagContribution checklist