Ticket #10 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Can't localize days

Reported by: Tomer Assigned to: 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

06/11/04 08:52:56 changed by Tomer

06/11/04 09:03:44 changed by JasonV

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

06/11/04 09:09:33 changed by Tomer

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.

06/11/04 09:15:36 changed by JasonV

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.

06/11/04 09:17:24 changed by JasonV

  • status changed from new to assigned.

06/11/04 09:33:46 changed by Tomer

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.

06/11/04 10:33:27 changed by ryan

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.

06/11/04 10:33:36 changed by ryan

  • owner changed from anonymous to rboren.
  • status changed from assigned to assigned.

08/08/04 18:55:42 changed by ryan

  • status changed from assigned to closed.
  • resolution changed from 10 to 20.

09/16/04 11:06:02 changed by matt

  • status changed from closed to closed.