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

MAGETWO-77672: <![CDATA[]]>in system.xml translate phrase not work, if comment starts from new line. #11675

Merged
merged 1 commit into from
Oct 24, 2017

Conversation

nmalevanec
Copy link
Contributor

Description

Fix for <![CDATA[]]> in system.xml translate phrase not work, if comment has spaces after opening tag, or before closing one(for instance: comment starts on new line). Ex:

<comment>
<![CDATA[Some comment]]>
</comment>

Fixed Issues (if relevant)

  1. <![CDATA[]]>in system.xml translate phrase not work  #7767: in system.xml translate phrase not work

Manual testing scenarios

  1. Create a module which has system.xml
  2. In the system.xml:
<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="foo_bar" translate="label" sortOrder="200">
            <label>Foo/Bar</label>
        </tab>
        <section id="foo_bar" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Foo/Bar</label>
            <tab>foo_bar</tab>
            <resource>Magento_Catalog::config_catalog</resource>
            <group id="test" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
                <field id="test" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Test phrases</label>
                    <comment>
                        <![CDATA[Some test comment here.]]>
                    </comment>
                </field>
            </group>
        </section>
    </system>
</config>

  1. Use the command to collect the phrases:
    bin/magento i18n:collect-phrases -o "/path_to_your_module/i18n/en_US.csv" path_to_your_module/dir
  2. Make some changes to translation in generated en_US.csv ex:
    "Some test comment here. add something new here "
  3. Clean cache.
  4. Navigate to admin>stores>configuration>Foo/Bar/>Foo/Bar/
  5. Check comment for field "Test phrases". It should has add something new here modification You have made in en_US.csv.

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)

@okorshenko okorshenko self-assigned this Oct 24, 2017
@okorshenko okorshenko added this to the October 2017 milestone Oct 24, 2017
@okorshenko okorshenko added Release Line: 2.2 2.2.x bug report Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release 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 24, 2017
@okorshenko okorshenko merged commit 42d2b53 into magento:2.2-develop Oct 24, 2017
okorshenko pushed a commit that referenced this pull request Oct 24, 2017
…ase not work, if comment starts from new line. #11675
@nmalevanec nmalevanec deleted the MAGETWO-77672 branch August 21, 2018 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Progress: accept Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants