Ticket #10 (closed defect (bug): fixed)

Opened 8 years ago

Last modified 8 years ago

Can't localize days

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

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

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};

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.

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.

  • Status changed from new to assigned

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.

comment:7   ryan8 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.

comment:8   ryan8 years ago

  • Owner changed from anonymous to rboren

comment:9   ryan8 years ago

  • Status changed from assigned to closed
  • Resolution changed from 10 to 20
Note: See TracTickets for help on using tickets.