Skip to content

[Translation] Adding the ability do dump <notes> in xliff2.0 #23890

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

Closed
wants to merge 4 commits into from

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Aug 14, 2017

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

The Xliff2.0 dumper do not dump notes. The note section is the only place (as far as I can see) you can add arbitrary data. See specification.

This will be useful when you want to add data like "approved", "status" etc. I can see from the test code that a previous author intends to use attributes to the for such data. That is not allowed, not even with a custom namespace.

If you want to validate my test fixture, here is the validator: http://okapi-lynx.appspot.com/validation

@Nyholm Nyholm changed the base branch from master to 3.4 August 14, 2017 20:08
@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Aug 15, 2017
$notesElement = $dom->createElement('notes');
foreach ($metadata['notes'] as $note) {
$n = $dom->createElement('note');
$n->appendChild($dom->createTextNode(isset($note['content']) ? $note['content'] : ''));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May we use $note['content'] ?? '' instead of isset($note['content']) ? $note['content'] : '' ?

Copy link
Member Author

@Nyholm Nyholm Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review.

This is for branch 3.4. We still support PHP5 in that branch. I actually just did: e12c555

Copy link

@BenjaminRbt BenjaminRbt Aug 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nyholm Alright, got it.

@nicolas-grekas
Copy link
Member

Thank you @Nyholm.

nicolas-grekas added a commit that referenced this pull request Aug 22, 2017
…iff2.0 (Nyholm)

This PR was squashed before being merged into the 3.4 branch (closes #23890).

Discussion
----------

[Translation] Adding the ability do dump <notes> in xliff2.0

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

The Xliff2.0 dumper do not dump notes. The note section is the only place (as far as I can see) you can add arbitrary data. See [specification](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html).

This will be useful when you want to add data like "approved", "status" etc. I can see from the test code that a previous author intends to use attributes to the <target> for such data. That is [not allowed](http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html#target), not even with a custom namespace.

If you want to validate my test fixture, here is the validator: http://okapi-lynx.appspot.com/validation

Commits
-------

c4dd11c [Translation] Adding the ability do dump <notes> in xliff2.0
@Nyholm
Copy link
Member Author

Nyholm commented Aug 22, 2017

Awesome. Thank you for merging.

fabpot added a commit that referenced this pull request Aug 26, 2017
…iff2.0 (Nyholm)

This PR was squashed before being merged into the 3.4 branch (closes #23947).

Discussion
----------

[Translation] Adding the ability do load <notes> in xliff2.0

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | ~~~~yes~~~ no (sorry)
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Since #23890 we can dump `<notes>`. We should also have the ability to load them back.

Commits
-------

b0cdb53 [Translation] Adding the ability do load <notes> in xliff2.0
This was referenced Oct 18, 2017
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