-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 #11175 - i18n:collect-phrases -m can't find many important Magento phrases - added parsing of the attr translations via $t('Text')
#31804
Conversation
… magento phrases - added parsing of the attr translations via `$t('Text')`
Hi @maksymz. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@ihor-sviziev Have just signed the Adobe CLA. Should I reopen the Pull Request? Don't know how to re-run the checks |
Hi @maksymz, thank you for your contribution! |
✔️ QA Passed Manual testing scenario:
<a data-bind="attr: { title: $t('This is \' test \' data for attribute translation with single quotes'), href: '#'} "></a>
<a data-bind="attr: { title: $t('This is test data for attribute translation with a quote after\'\''), href: '#'} "></a>
<a data-bind="attr: { title: $t('This is test data for attribute translation with a quote after\' \' '), href: '#'} "></a>
<input type="text" data-bind="attr: { placeholder: $t('Attribute translation - Placeholder'), title: $t('Attribute translation - Title') }" />
Before: ✖️ The above phrases are not present in the output. After: ✔️ Command output contains phrases in the Also added a few phrases that were not collected on the mainline. Run: The results can be seen in the comparison of the mainline and with changes from PR - diff |
@magento create issue |
…ortant Magento phrases - added parsing of the attr translations via `$t('Text')` #31804
Hi @maksymz, thank you for your contribution! |
Could this relate to my issue? #33772 |
Description (*)
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:
Documentation - Strings added in UI component templates
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 - magento.stackexchange.com)
Related Pull Requests
48216f3
Fixed Issues (if relevant)
Manual testing scenarios (*)
.html
file, for exampleapp/code/Magento/Catalog/view/frontend/web/template/product/addtocart-button.html
php bin/magento i18n:collect-phrases app/code/Magento/Catalog/view/frontend/web/template/product/
Expected result: Command output contains phrases in the
$t('Text')
translations that cat be then used in the i18n files.i18n output example:
Actual result: The above phrases are not present in the output.
Questions or comments
Contribution checklist (*)
Resolved issues:
$t('Text')
#31873: Fix i18n:collect-phrases -m can't find many important magento phrases #11175 - i18n:collect-phrases -m can't find many important Magento phrases - added parsing of the attr translations via$t('Text')