On Thursday 05 April 2007 14:44, S Page wrote:
> cnit wrote:
> > Also I believe that localized translations (eg. SMW_LanguageRu.php and
> > so on) should also provide a PHP-format string to correctly display
> > local dates, according to their "uselang" variable.
>
> Umm, can you be more specific as to what you want?  Are you talking
> about attributes of Type:Date?
>
> The post 0.6 SMW code in Subversion and on ontoworld.org allows you to
> control date datatype display, using [[main display unit:=%d %b ]] in
> attribute pages and [[date of birth:=*%b %d]] in inline queries.  See
> e.g. http://ontoworld.org/wiki/Attribute:Birthday
>
> That just relies on PHP's strftime() implementation to format the date.
>    PHP's strftime() is multilingual if you call setlocale() first, but I
> don't believe MediaWiki calls setlocale().  Instead it seems to have its
> own date formatting code in DateFormatter.php using its own localization
> strings.  Internally MediaWiki uses different format string syntax than
> strftime().
>
> Would you like SMW to by default display attributes of Type:Date
> according to the user's date and time preference in My Preferences?

Well, I think this would be very good. We currently have one problem though: 
many dates displayed by SMW are inserted into page texts that are the same 
for all users (i.e. the strings are stored in the parser cache). Hence, we 
cannot customise date output based on user settings in inline queries and in 
the Factbox. 

Anyway, we could at least format dates according to the wiki's content 
language in all cases. 

>
> I'd rather not introduce a new way to display dates in addition to what
> MediaWiki provides, so maybe exposing ways to format dates with a
> non-localized strftime() was a mistake.

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?

Currently we do not have any way of telling the Datavalue that it operates in 
a user context (and should use the user language). I think this would be a 
topic for the upcoming rewirte of the Datavalue code (which is not happening 
before 0.7).

>
> > My wiki project is multilangual and it uses three different values for
> > uselang (to provide the localized menus and so on).
>
> I'm curious how you do this.  If I set my language in My Preferences, I
> don't see localized SMW strings.  To see them I set $wgLanguageCode in
> LocalSettings.php.  Am I doing something wrong?

* Some SMW-messages are inserted into page text, and hence must be the same 
for all users. This currently includes the Factbox and inline queries, so 
that these are not adjusted to your user language.
* I recently updated SVN to a different method of identifying the user 
language. The old method seemed to have broken somewhere (maybe due to 
changes in MW or in SMW development). Maybe you have an unfortunate 
intermediate snapshot where the localisation fails.

>
> Thanks for your insight on these issues, it should help get localization
> right.
>
> --
> =S Page
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Semediawiki-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

-- 
Markus Krötzsch
Institute AIFB, University of Karlsruhe, D-76128 Karlsruhe
[EMAIL PROTECTED]        phone +49 (0)721 608 7362
www.aifb.uni-karlsruhe.de/WBS/     fax +49 (0)721 693  717

Attachment: pgpi5a6n0IteD.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Semediawiki-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Reply via email to