Opened 6 months ago

Closed 6 months ago

#22749 closed defect (bug) (fixed)

String needs plural format

Reported by: catiakitahara Owned by: nacin
Priority: normal Milestone: 3.5
Component: I18N Version: 3.5
Severity: major Keywords: has-patch commit i18n-change dev-reviewed
Cc: vanillalounge

Description

The string "selected" at wp-includes/media.php:1464 needs a plural format.

Attachments (3)

22749.diff (1.2 KB) - added by nacin 6 months ago.
22749.typo.fixed.diff (1.2 KB) - added by westi 6 months ago.
Fixes the typo in the phpdoc.
22749.typo.fixed.2.diff (1.2 KB) - added by SergeyBiryukov 6 months ago.

Download all attachments as: .zip

Change History (21)

comment:1 follow-up: ↓ 2   nacin6 months ago

We're not going to be able to do this for 3.5, as it requires #22229.

Best we can do is do '%d selected' and let you swap the order if your language does that.

comment:2 in reply to: ↑ 1   catiakitahara6 months ago

Replying to nacin:

Best we can do is do '%d selected' and let you swap the order if your language does that.

That wouldn't help for Portuguese, don't know about other languages.

Since we have only one string, we may be able to just hack in a quick JS function (with some code from #22229.

Easy way out: we go to "selected: %d".

Of course, if we included %d in the string, then translators could optionally go with 'selected: %d' on their own.

Easy way out.

  • Owner set to nacin
  • Status changed from new to assigned

nacin6 months ago

  • Keywords has-patch commit i18n-change added; needs-patch removed

This is ready to go. Want to wait to commit until Zé looks over the translators comment.

  • Milestone changed from Awaiting Review to 3.5

westi6 months ago

Fixes the typo in the phpdoc.

  • Keywords dev-reviewed added

Looks good to me, I fixed a typo in the phpdoc though :)

Awesome, I did not hope that this can happen in 3.5: http://core.trac.wordpress.org/ticket/22229#comment:17

"%d selected" is much better for many languages.

There is another case where we have to use this "pseudo-plural" form for comments number: #13651

22749.typo.fixed.2.diff fixes one more typo (two Ifs).

"%d selected" if we must, it's the least incorrect of the solutions. Post 3.5: this ticket either needs to stay open or we need a new one.

comment:14 follow-up: ↓ 15   kenan30086 months ago

Is this going to be commited for 3.5? I'm having the same issue in Bosnian. "%d selected" is a good workaround for my language too.

comment:15 in reply to: ↑ 14   knutsp6 months ago

Replying to kenan3008:

Is this going to be commited for 3.5? I'm having the same issue in Bosnian.

When this milestone is set by a lead developer (nacin), then to commit for that is the intention, I beleive.

In my language, Norwegian, we also need singular/plural forms for "selected" in this case, but "selected: %d" doesn't help.

In English, adjectives, like "selected" becomes this usage, do not have separate singular and plural forms, but in many other languages they do. Like in Norwegian:

"1 valgt", but "2 valgte"

On the other hand, if you say "% images are selected", then "selected" becomes a verb in preterite. In Norwegian, at least, verbs does not have different singular/plural forms.

Is there something else you can do with Norwegian? Even if you just translate the string to "%d" and let the numbers sit there by themselves. If the translation for "% items are selected" (it is not strictly images) is short, you can always use that.

Yes, can do a rewrite to get a verb out of it instead, at least in this case. Hope it fits the space without annoying line breaks.

  • Resolution set to fixed
  • Status changed from assigned to closed

In 23075:

Media: Use '%d selected' for the selection string, and offer a comment to translators to help them find a workable solution with this would-be plural string. fixes #22749. see #22229.

Note: See TracTickets for help on using tickets.