Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Translator] Load plurals from mo files properly#31267

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:3.4fromStadly:load-mo-plurals
Jul 8, 2019
Merged

[Translator] Load plurals from mo files properly#31267

fabpot merged 1 commit intosymfony:3.4fromStadly:load-mo-plurals
Jul 8, 2019

Conversation

@Stadly
Copy link
Contributor

@StadlyStadly commentedApr 26, 2019
edited
Loading

QA
Branch?3.4
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#10152 (comment)
LicenseMIT
Doc PR

Plurals were not handled correctly when loading mo files.

msgid "foo"msgid_plural "foos"msgstr[0] "bar"msgstr[1] "bars"

Before, the mo entry above was treated as two entries, which doesn't make sense:

'foo' => 'bar''foos' => '{0} bar|{1} bars'

With this PR, it is treated as one entry:

'foo|foos' => 'bar|bars'

This PR does the same as#31266, just for mo files instead of po files. Note, however, that the old behavior differed between po and mo files:'foos' => 'bar|bars' for po files and'foos' => '{0} bar|{1} bars' for mo files.

@StadlyStadly changed the titleLoad plurals from mo files properly[Translator] Load plurals from mo files properlyApr 26, 2019
@nicolas-grekasnicolas-grekas added this to thenext milestoneApr 27, 2019
@Stadly
Copy link
ContributorAuthor

@nicolas-grekas This should probably be added to the3.4 milestone rather thannext?

nicolas-grekas reacted with thumbs up emoji

@nicolas-grekasnicolas-grekas modified the milestones:next,3.4Apr 27, 2019
@Stadly
Copy link
ContributorAuthor

For those who need a MO loader that handles plurals, I have created a package providing this, while we're waiting for this PR to be merged.

https://github.com/Stadly/PhpTranslation

@fabpot
Copy link
Member

Thank you@Stadly.

@fabpotfabpot merged commit97d28b5 intosymfony:3.4Jul 8, 2019
fabpot added a commit that referenced this pull requestJul 8, 2019
This PR was merged into the 3.4 branch.Discussion----------[Translator] Load plurals from mo 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 mo files.```msgid "foo"msgid_plural "foos"msgstr[0] "bar"msgstr[1] "bars"```Before, the mo entry above was treated as two entries, which doesn't make sense:```'foo' => 'bar''foos' => '{0} bar|{1} bars'```With this PR, it is treated as one entry:```'foo|foos' => 'bar|bars'```This PR does the same as#31266, just for mo files instead of po files. Note, however, that the old behavior differed between po and mo files: `'foos' => 'bar|bars'` for po files and `'foos' => '{0} bar|{1} bars'` for mo files.Commits-------97d28b5 Load plurals from mo files properly
@StadlyStadly deleted the load-mo-plurals branchJuly 22, 2019 09:33
This was referencedJul 27, 2019
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.4

Development

Successfully merging this pull request may close these issues.

4 participants

@Stadly@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp