-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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
Conversation
$notesElement = $dom->createElement('notes'); | ||
foreach ($metadata['notes'] as $note) { | ||
$n = $dom->createElement('note'); | ||
$n->appendChild($dom->createTextNode(isset($note['content']) ? $note['content'] : '')); |
There was a problem hiding this comment.
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'] : ''
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Nyholm Alright, got it.
Thank you @Nyholm. |
…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
Awesome. Thank you for merging. |
…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
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