Skip to content

Backport of PR-10445 for Magento 2.1: Fix JS translation search #14349

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

Merged
merged 1 commit into from
Mar 26, 2018

Conversation

hostep
Copy link
Contributor

@hostep hostep commented Mar 24, 2018

Don't only replace ' but also " with ' and "

(cherry picked from commit a150d24)

Concatenate JS translations before translating them

This enables support for $.mage.__("concatenating" + "strings");

(cherry picked from commit c79b583)

+: put all regexes in cdata tags

(cherry picked from commit f930471)

Prevent translation string lookup from breaking on ' or " with a negative lookbehind

(cherry picked from commit 87d4ba4)

Support $.mage.('') as well as jQuery.mage.('')

(cherry picked from commit 5ae47df)

Description

This is a backport of #10445 for Magento 2.1

Fixed Issues (if relevant)

  1. JS Translation Regex leads to unexpected results and untranslatable strings #7403: JS Translation Regex leads to unexpected results and untranslatable strings

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Don't only replace \' but also \" with ' and "

(cherry picked from commit a150d24)

Concatenate JS translations before translating them

This enables support for $.mage.__("concatenating" + "strings");

(cherry picked from commit c79b583)

+: put all regexes in cdata tags

(cherry picked from commit f930471)

Prevent translation string lookup from breaking on \' or \" with a negative lookbehind

(cherry picked from commit 87d4ba4)

Support $.mage.__('') as well as jQuery.mage.__('')

(cherry picked from commit 5ae47df)
@hostep hostep force-pushed the backport-pr-10445 branch from 00f4ba7 to 893e4f2 Compare March 24, 2018 18:26
@hostep hostep changed the title Backport of PR-10445 for Magento 2.1 Backport of PR-10445 for Magento 2.1: Fix JS translation search Mar 24, 2018
@maghamed maghamed added the Event: distributed-cd Distributed Contribution Day label Mar 24, 2018
@ihor-sviziev ihor-sviziev self-assigned this Mar 24, 2018
@magento-engcom-team magento-engcom-team added this to the March 2018 milestone Mar 24, 2018
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-1068 has been created to process this Pull Request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants