Keep track of language.
Hallo all, i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check which language is selected? Thank you!! :-) pattreea.
Hi Pattreeya, Pattreeya Tanisaro wrote:
Hallo all, i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check which language is selected?
consider using the browsers preferences for this. The browser sends a accept-language: header which should be used with proper checking. This way a user is not forced to switch it on every page. You can learn more about this technic on http://www.apache.org (mod_negotiation) And of cource if you read http://www.faqs.org - rfc2616. If like to try, I've written a simple (not most elegant for all solutions but perfectly fitting for small pages and tests) vary-tag ( http://www.zope.org/Members/tino/VaryTag_release ) HTH Tino Wildenhain
i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check which language is selected?
You could store the language in a session :-) Check out the Core Session Product on http://www.zope.org. cheers, Chris
What is the difference between seting cookie and storing the language in session? pattreeya.
i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check
which
language is selected?
You could store the language in a session :-)
Check out the Core Session Product on http://www.zope.org.
cheers,
Chris
Mostly means that you don't have to manage the cookie. ----- Original Message ----- From: "Pattreeya Tanisaro" <pattreeya@lightwerk.com> To: "Chris Withers" <chrisw@nipltd.com> Cc: <zope@zope.org> Sent: Monday, March 12, 2001 12:46 PM Subject: Re: [Zope] Keep track of language.
What is the difference between seting cookie and storing the language in session?
pattreeya.
i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check
which
language is selected?
You could store the language in a session :-)
Check out the Core Session Product on http://www.zope.org.
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Phil, what are pros and cons of each method? I just heard about session the first time. pattreeya.
What is the difference between seting cookie and storing the language in session?
pattreeya.
i would like to create a homepage which have two languages. If I put
the
language flags in the menu, how can I keep track the language and
check
which
language is selected?
You could store the language in a session :-)
Check out the Core Session Product on http://www.zope.org.
cheers,
Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Try using Translator: http://www.zope.org/Members/fog/Translator - Holger Am Freitag, 9. März 2001 17:07 schrieben Sie:
Hallo all, i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check which language is selected?
Thank you!! :-) pattreea.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ----------------------------------- catWorkX GmbH Dipl.-Ing. Holger Lehmann Stresemannstr. 364 22761 Hamburg Tel: +49 (0700) catWorkX Tel: +49 (40) 890 646-0 Fax: +49 (40) 890 646-66 mailto:lehmann@catworkx.de http://www.catworkx.de http://www.catbridge.de
pattreea wrote:
i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check which language is selected?
This is how we do it... like Philippe said, we've split the site in two parts, /en for english and /gr for greek. /index_html is only a redirector: if user comes from the .gr domain, the browser is redirected to /gr, else to /en. Clicking the flag icon sends him to the other root, i.e. if his in /gr/anywhere and clicks on the english flag, he is sent to /en (and not /en/anywhere). This is done mainly because the two parts do *not* contain the same content. Dimitris @ Nuclear
Hi Dimitris, instead of using the toplevel domain-name, you schould look at the accept-language header from the browser. Did you think of the users neither using a .de or .gr domain provider? E.g. aol.com... Additionally, no flag is needed. (Only if you tell your users, how they can make the setting in their browsers the first time) May advice is further, create only folders and methods like /en /gr etc in them. the acquired index_html can make the choice and all links direct to the folder / Regards Tino Dimitris Andrakakis wrote:
pattreea wrote:
i would like to create a homepage which have two languages. If I put the language flags in the menu, how can I keep track the language and check which language is selected?
This is how we do it... like Philippe said, we've split the site in two parts, /en for english and /gr for greek. /index_html is only a redirector: if user comes from the .gr domain, the browser is redirected to /gr, else to /en. Clicking the flag icon sends him to the other root, i.e. if his in /gr/anywhere and clicks on the english flag, he is sent to /en (and not /en/anywhere). This is done mainly because the two parts do *not* contain the same content.
Dimitris @ Nuclear
participants (6)
-
Chris Withers -
Dimitris Andrakakis -
Holger Lehmann -
Pattreeya Tanisaro -
Phil Harris -
Tino Wildenhain