https://bugzilla.wikimedia.org/show_bug.cgi?id=19412

--- Comment #22 from Pavel Selitskas [wizardist] <[email protected]> ---
(In reply to comment #21)
> I beg to disagree with marking Bug 43714 as a duplicate of this one. There
> are
> two issues at hand:
> 
> 1) When the month name is in a non-English language (such as "mai" in French,
> which is the same as "may" in English), the bug can be solved by finding a
> way
> that would replace month names with their English counterpart, then uses
> php's
> strtotime. This is what current bug is all about.
> 
> 2) When there is a calendar involved (as in Bug 43714, which talks about the
> Jalali calendar), then a simple conversion of month names to English is not
> enough. As explained on PHP's documentation, strtotime only accepts certain
> date formats -- which are described on
> http://www.php.net/manual/en/datetime.formats.date.php -- and it ONLY works
> with the Gregorian calendar. So converting "آذر" to "Azar" (a Jalali month
> name) won't help anything in this case.
> 
> The possible solution with Bug 43714 is to take the date string (which is
> normally in Persian or English), figure out the Jalali date, use existing
> MediaWiki code to convert it to Gregorian date, then pass that to the wrapper
> function (such as the function that handles #time), and take the output of
> that
> wrapper function, use existing MediaWiki code to convert it back to Jalali,
> then localized to the user's language of choice and return the localized
> string.

I was watching bug 43714 from a quite more distant point. Currently, all
datetime-related stuff is processed by PHP internals. On the other hand, we
have CLDR (it stores all those intl'ed "+1 week") and MediaWiki calendar
conversion functions, which have been used here... never, I guess.

Adding work-arounds into ParserFunctions would be dirty, and this code would
demand not just refactoring, but rethinking and redesign. Moreover,
ParserFunctions is not the right place for "low-level" language manipulations.

We can forward prerequisite datetime conversion into Language, as well as
calendar detection, although if made straightforward, such piece of code would
not be ... beautiful, assuming that, given a certain locale (wgLanguage),
{{#time}} must accept every possible date format (in all terms: different month
names, different calendars, time spans, etc.).

Otherwise, you can remove the duplicate sign and make the bug dependent on this
one if it helps the community track the status of _their_ issue, of course!

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to