WordPress.org

Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 5 years ago

#10 closed defect (bug) (fixed)

Can't localize days

Reported by: Tomer Owned by: ryan
Milestone: Priority: normal
Severity: trivial Version:
Component: Template Keywords:
Focuses: Cc:

Description

I'm getting problems to localize day names.

#: wp-includes/locale.php:15
#: wp-includes/locale.php:21
msgid "S"
msgstr ""

We have the same string for Sunday and Saturday, which can't be translated while some languages have different short-name for those two distinct words.

Change History (11)

#2 @JasonV
15 years ago

Perhaps the single letter abbreviations ($weekday_initial) should be dynamically generated based on the (localized) full day names...

For example, instead of:

$weekday_initial[('Sunday')] = ('S');

we might have:

$weekday_initial[('Sunday')] = ('Sunday'){0};

#3 @Tomer
15 years ago

It is not the case here. In Hebrew, day names are "Rishon" (1st), "Sheni" (2nd), "Shlishi" (3rd) and so on, while the one-letter transformation for day names are "A", "B" and "C". All in Hebrew, of course.

#4 @JasonV
15 years ago

Interesting. Not as easy as I thought...

The first thing that comes to mind now is to use dummy text, such as this:

$weekday_initial[('Sunday')] = ('S_initial_for_Saturday'){0};
$weekday_initial[('Saturday')] = ('S_initial_for_Saturday'){0};

That would create unique text to be translated, as opposed to the current ('S'). Then for Hebrew you'd just have 'A_initial_for_Rishon', etc. But that may not be the best solution.

#5 @JasonV
15 years ago

  • Status changed from new to assigned

#6 @Tomer
15 years ago

Still, other languages might have another problems with this - what if specific language has no one-letter day names at all? I don't know such language, but it might be.

#7 @ryan
15 years ago

I'll probably use the dummy text workaround. For now, you can use the three letter abreviation instead of the initial by calling get_calendar(3). The three letter abbrevs can be uniquely translated. By the way, we can't use subscripting because php is not multibyte aware.

#8 @ryan
15 years ago

  • Owner changed from anonymous to rboren

#9 @ryan
15 years ago

  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.