Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #31266 [Translator] Load plurals from po files properly (Stadly)
This PR was squashed before being merged into the 3.4 branch (closes #31266). Discussion ---------- [Translator] Load plurals from po files properly | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #10152 (comment) | License | MIT | Doc PR | Plurals were not handled correctly when loading po files. ``` msgid "foo" msgid_plural "foos" msgstr[0] "bar" msgstr[1] "bars" ``` Before, the po entry above was treated as two entries, which doesn't make sense: ``` 'foo' => 'bar' 'foos' => 'bar|bars' ``` With this PR, it is treated as one entry: ``` 'foo|foos' => 'bar|bars' ``` Commits ------- 6b69a99 [Translator] Load plurals from po files properly
- Loading branch information
Showing
4 changed files
with
40 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
4 changes: 4 additions & 0 deletions
4
src/Symfony/Component/Translation/Tests/fixtures/missing-plurals.po
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
msgid "foo" | ||
msgid_plural "foos" | ||
msgstr[3] "bars" | ||
msgstr[1] "bar" |
This file contains 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