Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #31269 [Translator] Dump native plural formats to po files (S…
…tadly) This PR was submitted for the master branch but it was squashed and merged into the 4.4 branch instead (closes #31269). Discussion ---------- [Translator] Dump native plural formats to po files | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #29963, #10152 | License | MIT | Doc PR | Implementing support for dumping to the native po plural format. ``` 'foo|foos' => 'bar|bars' ``` Before, the entry above was dumped directly: ``` msgid "foo|foos" msgstr "bar|bars" ``` With this PR, it is dumped using the native po plural format: ``` msgid "foo" msgid_plural "foos" msgstr[0] "bar" msgstr[1] "bars" ``` Strings using explicit rules or contain more than 2 pluralization forms are still dumped directly, as the po format does not support such cases: ``` '{0} no foos|one foo|%count% foos' => '{0} no bars|one bar|%count% bars' ``` ``` msgid "{0} no foos|one foo|%count% foos" msgstr "{0} no bars|one bar|%count% bars" ``` This PR complements #31266, fixing loading of native po plural formats. Commits ------- dc31739 [Translator] Dump native plural formats to po files
- Loading branch information
Showing
4 changed files
with
81 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
msgid "" | ||
msgstr "" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Language: en\n" | ||
|
||
msgid "foo" | ||
msgid_plural "foos" | ||
msgstr[0] "bar" | ||
msgstr[1] "bars" | ||
|
||
msgid "{0} no foos|one foo|%count% foos" | ||
msgstr "{0} no bars|one bar|%count% bars" |