WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#33716 closed enhancement (fixed)

Remove the locale abbreviation hacks

Reported by: johnbillion Owned by: johnbillion
Milestone: 4.4 Priority: normal
Severity: minor Version: 1.5
Component: I18N Keywords: has-patch commit
Focuses: Cc:

Description

WP_Locale uses two nasty hacks for weekday initials and month abbreviations which involve appending a string to the abbreviations in order to make them unique.

These were introduced in [1518] and [2232] to fix #10 and #722 respectively.

I think it's time we switched to the dedicated _x() function, which is intended for this purpose. Is there any reason not to do this?

@ocean90 Is this something we can update in the existing translations database to avoid the need for re-translation?

Attachments (1)

33716.patch (6.3 KB) - added by johnbillion 6 years ago.

Download all attachments as: .zip

Change History (9)

@johnbillion
6 years ago

#1 @johnbillion
6 years ago

  • Keywords has-patch 2nd-opinion added

#2 @ocean90
6 years ago

  • Keywords commit added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to 4.4

Looks good, and yes, we can use existing translations for this.

#3 @wonderboymusic
6 years ago

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

#4 @SergeyBiryukov
6 years ago

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

In 34046:

Use _x() instead of string hacks for weekday and month abbreviations.

Props johnbillion.
Fixes #33716.

#5 follow-up: @pavelevap
6 years ago

+1

Is there any reason why using _x()? This function was designed for different usage of the same string? Translators comment should be enough?

#6 in reply to: ↑ 5 @SergeyBiryukov
6 years ago

Replying to pavelevap:

Is there any reason why using _x()? This function was designed for different usage of the same string? Translators comment should be enough?

'S' is ambiguous, it means both Saturday and Sunday. Same for 'T' (Tuesday and Thursday).

'May' is also ambiguous, it's used for both the full month name and the abbreviation, which may differ in some languages.

Others just use _x() for consistency.

#7 @pavelevap
6 years ago

Thank you, Sergey! I did not notice that, we have unique first letters for all days :-)

#8 @pavelevap
6 years ago

@SergeyBiryukov: Maybe we should also change translator comments? For our language is better two-letter abbreviation of each day, but translator comment suggests that we should use one-letter initial (and same for months).

Note: See TracTickets for help on using tickets.