Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#5015 closed defect (bug) (fixed)

Make year/month/week/day/... proper plurals and not individual strings

Reported by: vanillalounge's profile vanillalounge Owned by: boonebgorges's profile boonebgorges
Milestone: 1.8 Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Cc: vanillalounge

Description

In http://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-functions.php#L594, the duration strings are being called individually with __() gettext functions when they should be called as a group with _n().

The code currently assumes that there is only one plural form (i.e. 'one' and 'many') when many languages have way more complex plural forms. Polish, for instance has an expression for 1, another for 2--4, 22--24, 32--34, 42--44, ... and yet another for 0, 5--21, 25--31, 35--41, ...

_n() handles these properly, for all languages supported by GlotPress.

Attachments (1)

5015.patch (3.8 KB) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (9)

#1 @vanillalounge
11 years ago

  • Cc vanillalounge added

#2 @SergeyBiryukov
11 years ago

Introduced in [624] as a fix for #154. Also mentioned in ticket:190:4.

Related: #3056

#3 @SergeyBiryukov
11 years ago

  • Keywords has-patch added

5015.patch uses _n() for proper i18n.

#4 @boonebgorges
11 years ago

In 7101:

Adds unit tests for bp_core_time_since()

See #5017. See #5015

#5 @boonebgorges
11 years ago

Thanks for the report and for the patch. Looks good.

#6 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 1.8

#7 @boonebgorges
11 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7102:

Use _n() for plurals in bp_core_time_since()

The previous implementation used a hardcoded distinction between singular and
plurals, which is not flexible enough for many languages.

Fixes #5015

Props SergeyBiryukov

#8 @DJPaul
8 years ago

  • Component changed from Locale - i18n to I18N
Note: See TracTickets for help on using tickets.