Skip to content
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

i18n:collect-phrases -m can't find many important magento phrases #11175

Closed
scholtz opened this issue Oct 2, 2017 · 11 comments · Fixed by #30320 or #31804
Closed

i18n:collect-phrases -m can't find many important magento phrases #11175

scholtz opened this issue Oct 2, 2017 · 11 comments · Fixed by #30320 or #31804
Assignees
Labels
Component: Locale Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@scholtz
Copy link

scholtz commented Oct 2, 2017

Summary
This is continuation of thread #2630
Magento 2.2 clear installation using script http://apps.scholtz.sk/magento.install.script.txt

Preconditions

  1. Magento 2.4-develop
  2. PHP 7.1, Nginx, Mysql 5.7

Steps to reproduce

  1. Install Magento and download SK language pack
  2. do collect phrases php bin/magento i18n:collect-phrases -o "$VER.csv" -m
  3. translate phrases
  4. Check translations in admin

(I have full translation of magento to slovak language, so i skip step 2 i install it through the script listed above)

Expected result

I expect all texts to be localised

Actual result

Some phrases are not translated.. Btw, i can see some progress in the 2 years work now, but still some are missing..

obrazok
obrazok
obrazok
obrazok
obrazok
obrazok

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed labels Oct 2, 2017
@magento-engcom-team
Copy link
Contributor

@scholtz, thank you for your report.
We've created internal ticket(s) MAGETWO-80604 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 2, 2017
@PascalBrouwers
Copy link
Contributor

Added a PR for 2.2-develop.

@PascalBrouwers
Copy link
Contributor

Added a PR for 2.3-develop while we're at it.

@sdzhepa sdzhepa removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Dec 7, 2019
@engcom-Charlie engcom-Charlie self-assigned this Dec 9, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 9, 2019

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Charlie engcom-Charlie added Component: Locale Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Dec 9, 2019
@sidolov sidolov added this to Ready for Development in Low Priority Backlog Sep 24, 2020
@Bartlomiejsz
Copy link
Contributor

@magento I am working on this

@magento-engcom-team
Copy link
Contributor

Hi @scholtz. Thank you for your report.
The issue has been fixed in #30320 by @Bartlomiejsz in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.2 release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Oct 15, 2020
@m2-community-project m2-community-project bot moved this from Dev In Progress to Done in Low Priority Backlog Oct 15, 2020
magento-engcom-team added a commit that referenced this issue Oct 15, 2020
…ortant magento phrases #30320

 - Merge Pull Request #30320 from Bartlomiejsz/magento2:bugfix/11175_collect_phrases
 - Merged commits:
   1. 48216f3
magento-engcom-team pushed a commit that referenced this issue Oct 15, 2020
@maksymz
Copy link
Contributor

maksymz commented Jan 20, 2021

Hi, @scholtz and @magento-engcom-team !

According to the official Magento 2 documentations, there is a way to translate HTML attributes, but this is not covered as well. Here is a text from the documentation:

When a string is added as an attribute of an HTML element:

<input type="text" data-bind="attr: {placeholder: $t('First Name')}" />

https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/translations/translate_theory.html

This was of translating attributes does not seem to be used in the Magento 2 itself (if my search is correct). Though, it is officially documented, is used by some vendors and it can be found in some Q&A on the Internet ( like here - https://magento.stackexchange.com/questions/181070/magento-2-translate-input-placeholder-attribute-string-in-knockout-html-templat )

As a result, this is still a potential issue I think...

Regards,
Max

@maksymz
Copy link
Contributor

maksymz commented Jan 21, 2021

Possible additional regular expression for the class \Magento\Setup\Module\I18n\Parser\Adapter\Html is:

'/\\$t\(\s*([\'"])(?<value>.*?[^\\\])\1.*?[),]/i'

This is the same as in \Magento\Setup\Module\I18n\Parser\Adapter\Js with ?<value> to catch the text itself for further processing

@hostep
Copy link
Contributor

hostep commented Jan 21, 2021

Hi @maksymz, feel free to open a pull request with your suggest fix. If that's not possible somehow, I'd recommend you to open a new issue instead of commenting on an old closed one which is considered fixed. Thanks! 🙂

maksymz added a commit to maksymz/magento2 that referenced this issue Jan 22, 2021
… magento phrases - added parsing of the attr translations via `$t('Text')`
maksymz added a commit to maksymz/magento2 that referenced this issue Jan 27, 2021
… magento phrases - made patterns case-sensitive because translations does not work with uppercase bindings/tags/function names
maksymz added a commit to maksymz/magento2 that referenced this issue Jan 27, 2021
… magento phrases - moved patterns to constants, updated JS parser test
@gabrieldagama
Copy link
Contributor

Hi @scholtz. Thank you for your report.
The issue has been fixed in #31804 by @maksymz in 2.4-develop branch
Related commit(s):

The fix will be available with the upcoming 2.4.3 release.

magento-engcom-team added a commit that referenced this issue Feb 18, 2021
…ortant Magento phrases - added parsing of the attr translations via \`$t('Text')\` #31804

 - Merge Pull Request #31804 from maksymz/magento2:2.4-develop
 - Merged commits:
   1. 754ea5f
   2. 77daafd
   3. f847294
magento-engcom-team pushed a commit that referenced this issue Feb 18, 2021
…ortant Magento phrases - added parsing of the attr translations via `$t('Text')` #31804
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Locale Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Community Backlog
  
Ready for Dev