Closed
Description
Preconditions
php 5.6.19
Magento 2.1.2
Steps to reproduce
create a module which has system.xml
In the system.xml, I have a field:
<field id="test" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Test phrases</label>
<attribute type="shared">1</attribute>
<comment>
<![CDATA[This is for wq test!
<a href="https://developer.paypal.com/docs/classic/express-checkout/in-context/" target="_blank">here</a>.]]>
</comment>
</field>
I use the command to collect the phrases
i18n:collect-phrases -o "zh_Hans_CN.csv" mymodule/dir
I get the csv file. In this file, I see:
This is for wq test!
<a href=""https://developer.paypal.com/docs/classic/express-checkout/in-context/"" target=""_blank"">here</a>.
","
This is for wq test!
<a href=""https://developer.paypal.com/docs/classic/express-checkout/in-context/"" target=""_blank"">here</a>.
"
There is a line feed and some spaces before the phrase.
I change the second column to add some Chinese words.
This is for wq test!
<a href=""https://developer.paypal.com/docs/classic/express-checkout/in-context/"" target=""_blank"">here</a>.
","
This is for wq test!应该看到我
<a href=""https://developer.paypal.com/docs/classic/express-checkout/in-context/"" target=""_blank"">here</a>.
"
I put this file in correct place and change the local language. Other simple phrases can be translated correctly, but the phrase in CDATA doesn't change.
Then I delete the line feed and spaces:
"This is for wq test!<a href=""https://developer.paypal.com/docs/classic/express-checkout/in-context/"" target=""_blank"">here</a>.","This is for wq test!按道理应该看到我<a href=""https://developer.paypal.com/docs/classic/express-checkout/in-context/"" target=""_blank"">here</a>."
I ran setup:upgrade
to make Magento use new translation. But It still doesn't work!
Another test about translate
echo __('This is for wq
test!');
Just for test line feed in csv file.
Collect phrases:
"This is for wq
test!","This is for wq
test!"
change this to
"This is for wq
test!","This is for wq
test!按照道理我会出来"
It works!
Metadata
Metadata
Assignees
Labels
Gate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Failed. Automatic verification of issue format is failedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release