Markus Krötzsch wrote:

> Yes, I think we should switch to MW's formatting methods, using the content 
> language.
> 
> S: could you make this happen easily, or would this be difficult?

I checked it in.

        $mwDateTime = date('YmdHis', $time);
        if ( abs($time - strtotime($date_part)) > 0.5) {
                $user_val = $wgContLang->timeanddate($mwDateTime);
        } else {
                $user_val = $wgContLang->date($mwDateTime);
        }

This makes dates in the factbox and inline queries display in the date 
and date+time format the user prefers.  I don't see the French names for 
months unless I change the site's $wgLanguageCode in LocalSettings.php.


You can still override this by specifying a strftime() format string in 
an inline query or in a [[main display unit:=]] special property for the 
attribute.  I could switch that customization to use MediaWiki's format 
strings (e.g. in a query
   [[date of birth:=*M d]]
instead of strftime()'s
   [[date of birth:=*%b %d]]
MediaWiki's format strings are based on PHP's date() format characters 
but the specifics aren't documented.

I'm not sure how MediaWiki handles preferences that change page text: 
does it cache different versions of the page for each locale+preference, 
or does it not cache variable text, or does variable text disable caching?


Another thing I have to figure out is what ought to happen on a site 
that enables dynamic dates (
   $wgUseDynamicDates = true;
, see http://meta.wikimedia.org/wiki/Help:Date_formatting_feature) so 
dates turn into a pair of day and year links as they do on 
wikipedia.org.  User:Patrick was trying to simulate this on 
ontoworld.org (which doesn't seem to have this feature enabled).

Sorry to ramble... sorry I'm not more expert on MW internals... sorry I 
keep apologizing :-)

--
=S Page

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to