List Info

Thread: how does lenya handle the locale setting?




how does lenya handle the locale setting?
user name
2007-01-23 05:02:33
hi *! i've been fiddling with a language selector, and i realized that we currently have three totally orthogonal ways of handling language: 1. requesting a translation of a document by calling foo_.html or lenya-document:,lang=. 2. the locale setting in the request object. 3. the ?locale= request parameter. the first obviously governs in which way the content is presented, but the second is relevant to the I18nTransformer. the third does not seem to be used with lenya. 2 questions: how do i set the locale? i know there is an action, but a page in the cocoon wiki says that "actions are going out of fashion", whatever that means. should (1) and (2) always be in sync? for live, i'd say yes. for authoring, syncing would mean that someone who works with foreign language content also gets translated lenya menus. slightly odd, but for simplicity i'd say we should gang the two. thanks, jörn -- Jörn Nettingsmeier "Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law." - Douglas R. Hofstadter --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribelenya.apache.org For additional commands, e-mail: dev-helplenya.apache.org
Re: how does lenya handle the locale setting?
user name
2007-01-23 10:32:21
Andreas Hartmann wrote: > Jörn Nettingsmeier schrieb: >> hi *! >> >> >> i've been fiddling with a language selector, and i realized that we >> currently have three totally orthogonal ways of handling language: >> >> 1. requesting a translation of a document by calling foo_.html or >> lenya-document:,lang=. >> 2. the locale setting in the request object. >> 3. the ?locale= request parameter. >> >> the first obviously governs in which way the content is presented, but >> the second is relevant to the I18nTransformer. the third does not seem >> to be used with lenya. >> >> 2 questions: >> >> how do i set the locale? i know there is an action, but a page in the >> cocoon wiki says that "actions are going out of fashion", whatever that >> means. > > What do you mean with "set the locale"? > AFAIK the locale is set by the user agent. > You can access it using {request:locale}. i know. but if a user requests a translated version of a page, the I18n-ized parts should change too (such as the menu items). as it is now, you can click on a flag, and only the content changes, not the menu or in fact anything that uses the i18ntransformer. >> should (1) and (2) always be in sync? for live, i'd say yes. for >> authoring, syncing would mean that someone who works with foreign >> language content also gets translated lenya menus. slightly odd, but for >> simplicity i'd say we should gang the two. > > IMO we shouldn't sync them. Changing the i18n of the GUI when changing > the page language would IMO lead to an inconsistent look&feel. agreed, if there is a simple way to differentiate between GUI locale and locale for I18n-ized content. > Usually you have two i18n transformer configurations in your project, > one for the Lenya GUI and the other for the i18n of page contents > (i.e., to add internationalized text snippets to the page, like > "Read more" / "Lesen Sie mehr" below a teaser). The latter uses the > locale of the requested page. so, to rephrase my question: how do i change the locale of a session when a user clicks on a flag to change the language, so that menus etc. are displayed in the new language? -- jörn nettingsmeier home://germany/45128 essen/lortzingstr. 11/ http://spunk.dnsalias.org phone://+49/201/491621 if you are a free (as in "free speech") software developer and you happen to be travelling near my home, drop me a line and come round for a free (as in "free beer") beer. :-D --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribelenya.apache.org For additional commands, e-mail: dev-helplenya.apache.org
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )