[pmwiki-users] MultiLanguage --- again (setting default language)

blues blues4u at supereva.it
Mon Feb 5 09:16:15 CST 2007


On Mon, 05 Feb 2007 16:28:31 +0200, Tom Lederer <celok at gmx.net> wrote:
> 1. i still somewhat desperatly search for a way to define the default
> language of a site in a fashion that if there is no (:if userlang
> XX:) is in a page, it is clear to the script that the page is in my
> default language (German for me). I noticed that (:if userlang XX:)
> in SideBar, GroupHeader, etc... do have no effect.

the fact here (that others also misunderstand) is that a text that is
not included in a (:if:) branch does NOT mean that it is in the default
language.
consider the following (your default language is german):

(:if userlang en:)
text in english
(:if userlang de:)
text in german
(:if:)
text for ALL languages

as you see the text that is outside the (:if:) branches is NOT
the default language but displayed for ALL languages.


> 2. In the documentation there is a part i do not understand fully,
> maybe someone can clear that up (for me):
>
>> You can put (:selectlang:) anywere in a page to display links to
>> the available languages for that page.
>> The following parameters can be used:
>> page=... to specify the page for which display the links.
>> default=... to specify a default page for languages present in the
>> $DefaultLanguages but who are not defined in the page (useful to
>> direct the user to a homepage).
>
> What does default= set? And how?

maybe the documentation is not clear.
let's suppose you have: $DefaultLanguages = array('de','en');
which says that in your site you have german and english
versions, in this order of preference.
if in a certain page the english is not defined then using the
default= option will still display the link for english but it
will redirect to the page specified (for example a home page).
if default= is not specified then only the links for the defined
languages will be displayed.


> 3. Also an idea for an improvement (i can not implement myself, cause
> then i would have done it), would be to give the ?userlang= links a
> css class in order to mark the active one.

that's a good idea. i will consider it for a future version.

blues




More information about the pmwiki-users mailing list