#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)
#3
@
21 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
@
21 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.
#6
@
21 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
@
21 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.
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};