Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

Multilingual Magic Words?

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


john at stonewayconsulting

Aug 24, 2009, 2:05 PM

Post #1 of 5 (756 views)
Permalink
Multilingual Magic Words?

Hi all,

I manage a private wiki for an organization whose users are both English
and French. They would like to be able to use some of the Date & Time
variable Magic Words, having the results displayed in the users'
language of choice. So, using {{CURRENTDAY}} would produce either
"Monday" or "Lundi", depending. I was rather surprised to see that just
changing my user's preferences did not force this translation
automatically, as it does for the interface and navigation links.

When my language preferences are set to either "En" or "Fr", using the
Magic Word {{LOCALMONTHNAME}} produces "August", invariably.

Do I have to create a new extension to handle this kind of
functionality, or should this just work and I am suffering from some
unknown pilot error?

Thanks,

John

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Aug 24, 2009, 2:25 PM

Post #2 of 5 (712 views)
Permalink
Re: Multilingual Magic Words? [In reply to]

John Thomson wrote:
> Hi all,
>
> I manage a private wiki for an organization whose users are both English
> and French. They would like to be able to use some of the Date & Time
> variable Magic Words, having the results displayed in the users'
> language of choice. So, using {{CURRENTDAY}} would produce either
> "Monday" or "Lundi", depending. I was rather surprised to see that just
> changing my user's preferences did not force this translation
> automatically, as it does for the interface and navigation links.
>
> When my language preferences are set to either "En" or "Fr", using the
> Magic Word {{LOCALMONTHNAME}} produces "August", invariably.
>
> Do I have to create a new extension to handle this kind of
> functionality, or should this just work and I am suffering from some
> unknown pilot error?
>
> Thanks,
>
> John

Since they are content, they appear in the wiki content language.
If you want to have it shown in the users language, open
includes/parser/parser.php and at function getVariableValue change
$wgContLang to $wgLang (remember to do a global $wgContLang).
But you will need to disable caching there to avoid an "English" user
viewing the French months after a "French" user visited the page.


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


tor at wikia-inc

Aug 24, 2009, 2:27 PM

Post #3 of 5 (718 views)
Permalink
Re: Multilingual Magic Words? [In reply to]

On Mon, Aug 24, 2009 at 11:05 PM, John
Thomson<john [at] stonewayconsulting> wrote:
> Hi all,
>
> I manage a private wiki for an organization whose users are both English
> and French.  They would like to be able to use some of the Date & Time
> variable Magic Words, having the results displayed in the users'
> language of choice.  So, using {{CURRENTDAY}} would produce either
> "Monday" or "Lundi", depending.  I was rather surprised to see that just
> changing my user's preferences did not force this translation
> automatically, as it does for the interface and navigation links.
>
> When my language preferences are set to either "En" or "Fr", using the
> Magic Word {{LOCALMONTHNAME}} produces "August", invariably.
>
> Do I have to create a new extension to handle this kind of
> functionality, or should this just work and I am suffering from some
> unknown pilot error?

You must first understand the difference between the language of the
wiki (ContentLanguage) and the language set in the user's preferences
(UserLanguage).

While UserLanguage may change from user to user, and even for the same
user as he modifies his preferences, ContentLanguage stays the same
for any given wiki and will not change.

UserLang is used to display the correct *interface* to the user, while
ContentLanguage is used to display the *content* or *article*.

You are using the magic words mentioned within the article, which
means that, quite logically, ContentLanguage governs how they are
interpreted and rendered.

This is not a bug, but rather a matter of design.

--
Lucas 'TOR' Garczewski
Wikia Tech Team

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


john at stonewayconsulting

Aug 24, 2009, 4:18 PM

Post #4 of 5 (715 views)
Permalink
Re: Multilingual Magic Words? [In reply to]

Platonides wrote:
> John Thomson wrote:
>
>> Hi all,
>>
>> I manage a private wiki for an organization whose users are both English
>> and French. They would like to be able to use some of the Date & Time
>> variable Magic Words, having the results displayed in the users'
>> language of choice. So, using {{CURRENTDAY}} would produce either
>> "Monday" or "Lundi", depending. I was rather surprised to see that just
>> changing my user's preferences did not force this translation
>> automatically, as it does for the interface and navigation links.
>>
>> When my language preferences are set to either "En" or "Fr", using the
>> Magic Word {{LOCALMONTHNAME}} produces "August", invariably.
>>
>> Do I have to create a new extension to handle this kind of
>> functionality, or should this just work and I am suffering from some
>> unknown pilot error?
>>
>> Thanks,
>>
>> John
>>
>
> Since they are content, they appear in the wiki content language.
> If you want to have it shown in the users language, open
> includes/parser/parser.php and at function getVariableValue change
> $wgContLang to $wgLang (remember to do a global $wgContLang).
> But you will need to disable caching there to avoid an "English" user
> viewing the French months after a "French" user visited the page.
Fantastic! Thanks, Platonides!! Worked like a charm!

Thanks to you as well, Lukasz. You've both been tremendously helpful to me.

John

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


jidanni at jidanni

Aug 24, 2009, 4:32 PM

Post #5 of 5 (706 views)
Permalink
Re: Multilingual Magic Words? [In reply to]

>>>>> "JT" == John Thomson <john [at] stonewayconsulting> writes:
JT> Platonides wrote:
>> open includes/parser/parser.php and at function getVariableValue
>> change $wgContLang to ...
JT> Fantastic! Thanks, Platonides!! Worked like a charm!
The headaches will of course reappear when you one day upgrade Mediawiki
and the file gets overwritten and you don't remember what you changed...

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.