[Translation] Process multiple segments within a single unit.#26247
Closed
timewasted wants to merge 3 commits intosymfony:masterfrom
Closed
[Translation] Process multiple segments within a single unit.#26247timewasted wants to merge 3 commits intosymfony:masterfrom
timewasted wants to merge 3 commits intosymfony:masterfrom
Conversation
Xliff 2.0 supports multiple segments within a single unit, but the loader was only processing the first segment. The loader will now correctly process all segments within a unit.
phansys
suggested changes
Feb 20, 2018
| $resource = __DIR__.'/../fixtures/resources-2.0-multi-segment-unit.xlf'; | ||
| $catalog = $loader->load($resource, 'en', 'domain1'); | ||
|
|
||
| $this->assertEquals('en', $catalog->getLocale()); |
Contributor
There was a problem hiding this comment.
Please, whenever possible, use assertSame() instead.
When performing tests, prefer using assertSame() over assertEquals() where possible.
Member
|
For 3.4, best reviewed ignoring whitespace. Status: needs review |
Nyholm
approved these changes
Feb 21, 2018
Member
There was a problem hiding this comment.
According to specification you may have one or more segments in a unit. The implementation looks good.
phansys
approved these changes
Feb 21, 2018
phansys
suggested changes
Feb 21, 2018
|
|
||
| $this->assertSame('en', $catalog->getLocale()); | ||
| $this->assertEquals(array(new FileResource($resource)), $catalog->getResources()); | ||
| $this->assertSame(array(), libxml_get_errors()); |
Contributor
There was a problem hiding this comment.
IMO, $this->assertFalse(libxml_get_last_error()); would be better.
Instead of checking libxml_get_errors() for an empty array, we should check libxml_get_last_error() for false to make the intent of the assertion more clear.
Simperfit
approved these changes
Feb 21, 2018
fabpot
approved these changes
Feb 22, 2018
Member
|
Thank you @timewasted. |
fabpot
added a commit
that referenced
this pull request
Feb 22, 2018
…it. (timewasted) This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #26247). Discussion ---------- [Translation] Process multiple segments within a single unit. | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Xliff 2.0 supports multiple segments within a single unit, but the loader was only processing the first segment. The loader will now correctly process all segments within a unit. Commits ------- ac5d01f [Translation] Process multiple segments within a single unit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Xliff 2.0 supports multiple segments within a single unit, but the
loader was only processing the first segment. The loader will now
correctly process all segments within a unit.