Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#33716 closed enhancement (fixed)

Remove the locale abbreviation hacks

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

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 11 years ago.

Download all attachments as: .zip

Change History (9)

@johnbillion
11 years ago

#1 @johnbillion
11 years ago

  • Keywords has-patch 2nd-opinion added

#2 @ocean90
11 years ago

  • Keywords commit added; 2nd-opinion removed
  • Milestone Awaiting Review4.4

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

#3 @wonderboymusic
11 years ago

  • Owner set to johnbillion
  • Status newassigned

#4 @SergeyBiryukov
11 years ago

  • Resolutionfixed
  • Status assignedclosed

In 34046:

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

Props johnbillion.
Fixes #33716.

#5 follow-up: @pavelevap
11 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
11 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
11 years ago

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

#8 @pavelevap
11 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.