Skip to content
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

[Translator] Dump native plural formats to po files #31269

Merged
merged 1 commit into from Jul 8, 2019
Merged

[Translator] Dump native plural formats to po files #31269

merged 1 commit into from Jul 8, 2019

Conversation

Stadly
Copy link
Contributor

@Stadly Stadly commented Apr 26, 2019

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.

@Stadly
Copy link
Contributor Author

Stadly commented Apr 26, 2019

I don't think the failing builds has anything to do with this PR.

@Stadly Stadly changed the title Dump native plural formats to po files [Translator] Dump native plural formats to po files Apr 26, 2019
@nicolas-grekas nicolas-grekas added this to the next milestone Apr 27, 2019
@Stadly
Copy link
Contributor Author

Stadly commented May 9, 2019

Is there anything I can do to help this make it into version 4.3? #31266 should be merged first, at least, as dumping something that is not loaded correctly doesn't make sense.

Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

for 4.4

@fabpot fabpot changed the base branch from master to 4.4 July 8, 2019 08:26
@fabpot
Copy link
Member

fabpot commented Jul 8, 2019

Thank you @Stadly.

@fabpot fabpot merged commit dc31739 into symfony:4.4 Jul 8, 2019
fabpot added a commit that referenced this pull request Jul 8, 2019
…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
@Stadly Stadly deleted the dump-po-plurals branch July 22, 2019 09:38
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
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.

None yet

4 participants