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 wrong value in file id attribute for Xliff 2.0 #30074

Merged
merged 1 commit into from Feb 7, 2019

Conversation

Projects
None yet
6 participants
@deguif
Copy link
Contributor

deguif commented Feb 4, 2019

Q A
Branch? 4.2
Bug fix? yes
New feature? no
BC breaks? ?
Deprecations? no
Tests pass? ?
Fixed tickets
License MIT
Doc PR

Currently using the XliffFileDumper for exporting messages from catalogue with domain of the form xxxx+intl-icu produces an invalid Xliff version 2.0 file as the file id attribute is of type xs:NMTOKEN (cf. https://github.com/symfony/translation/blob/master/Resources/schemas/xliff-core-2.0.xsd#L139) which doesn't accept + character (cf. http://www.datypic.com/sc/xsd/t-xsd_NMTOKEN.html).
Exception is thrown when loading the content after.

@deguif deguif changed the base branch from master to 4.2 Feb 4, 2019

@deguif deguif force-pushed the deguif:xliff-file-dumper branch from f32f037 to 02614ef Feb 4, 2019

@OskarStark
Copy link
Contributor

OskarStark left a comment

Could you add a test for this case?

@nicolas-grekas nicolas-grekas added this to the 4.2 milestone Feb 5, 2019

@deguif deguif force-pushed the deguif:xliff-file-dumper branch 2 times, most recently from 8043038 to 8ed345e Feb 5, 2019

@deguif

This comment has been minimized.

Copy link
Contributor Author

deguif commented Feb 5, 2019

Tests added, and tests are green ;)

@deguif deguif force-pushed the deguif:xliff-file-dumper branch from 8ed345e to 6006b43 Feb 5, 2019

@OskarStark

This comment has been minimized.

Copy link
Contributor

OskarStark commented Feb 5, 2019

Thank you very much

@xabbuh

xabbuh approved these changes Feb 5, 2019

@nicolas-grekas nicolas-grekas force-pushed the deguif:xliff-file-dumper branch from 6006b43 to 8bf12f8 Feb 7, 2019

@nicolas-grekas

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Feb 7, 2019

Thank you @deguif.

@nicolas-grekas nicolas-grekas merged commit 8bf12f8 into symfony:4.2 Feb 7, 2019

1 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
fabbot.io Your code looks good.
Details

nicolas-grekas added a commit that referenced this pull request Feb 7, 2019

bug #30074 Fix wrong value in file id attribute for Xliff 2.0 (deguif)
This PR was squashed before being merged into the 4.2 branch (closes #30074).

Discussion
----------

Fix wrong value in file id attribute for Xliff 2.0

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | ?
| Deprecations? | no
| Tests pass?   | ?
| Fixed tickets |
| License       | MIT
| Doc PR        |

Currently using the `XliffFileDumper` for exporting messages from catalogue with domain of the form `xxxx+intl-icu` produces an invalid Xliff version 2.0 file as the file id attribute is of type `xs:NMTOKEN` (cf. https://github.com/symfony/translation/blob/master/Resources/schemas/xliff-core-2.0.xsd#L139) which doesn't accept `+` character (cf. http://www.datypic.com/sc/xsd/t-xsd_NMTOKEN.html).
Exception is thrown when loading the content after.

Commits
-------

8bf12f8 Fix wrong value in file id attribute for Xliff 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment