#6368 closed defect (bug) (fixed)
Use proper plural forms in languages with more than two forms
Reported by: | netweb | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch |
Cc: |
Description
Reported via #polyglots on Slack by @ romanbon https://wordpress.slack.com/archives/polyglots/p1428678160001062
Hi, in Ukrainian language Singular form and Plural form for 21, 31... are the same. Sometimes it causes certain problems translating certain strings (problems can be avoided in most cases). Can someone explain me how to handle translation of such strings in the <em>right way</em>?
Via @sergeybiryukov see:
Attachments (4)
Change History (19)
This ticket was mentioned in Slack in #polyglots by netweb. View the logs.
10 years ago
#3
in reply to:
↑ 2
@
10 years ago
- Keywords has-patch added; needs-patch removed
Replying to boonebgorges:
Does that seem right to others?
That pattern looks correct, yes. That's what we use in core now.
I've reviewed all other uses of _n()
and fixed the affected instances. Also fixed another issue with those strings: _n()
show receive an integer (e.g. $blogs_template->total_blog_count
) as its third argument, not a string returned by bp_core_number_format()
(e.g. $total
).
Would appreciate a second pair of eyes to make sure there are no copy/paste errors.
The second patch is for bbPress external. Not sure if it's still used or supported anymore. Should the patch be submitted to bbPress Trac? Attached it here for reference.
#5
@
10 years ago
- Owner set to boonebgorges
- Resolution set to fixed
- Status changed from new to closed
In 9765:
This ticket was mentioned in Slack in #buddypress by netweb. View the logs.
10 years ago
#8
follow-up:
↓ 13
@
10 years ago
netweb - Thanks for the catch. Not sure if those instances are actually wrong though.
Check out these similar strings in WP trunk:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/edit-comments.php?marks=189,197,201,204#L183
Could use some feedback from a localization expert!
#9
@
10 years ago
Could use some feedback from a localization expert!
That's not me :) but I think netweb is right. The primary difference between the bp-messages-star examples he lists, and the core examples you point to, is that the former strings have 1
hardcoded into them. The general rule is arising out of https://core.trac.wordpress.org/ticket/28502#comment:23: string pairs in _n()
should be exactly the same, except for the plural status of the noun (in English: comment
vs comments
). If a particular number, like 1, needs its own syntax ("Just a single comment left!"), it should be its own string, outside of _n()
. The bp-messages-star examples look like cases where simply swapping 1
with %s
would be enough.
#10
@
10 years ago
The bp-messages-star examples look like cases where simply swapping 1 with %s would be enough.
Gotcha. Serves me right for replying in the wee hours of the morning!
The key point seems to be this:
The "single" English string will be used in Slavic languages for 21, 31, etc. So that means our new pagination pattern will look something like 6368.diff. Does that seem right to others? If so, we'll need a patch that covers all such pagination strings, and probably a review of other uses of
_n()
.