uri-based locale-selection

15 views
Skip to first unread message

andreak

unread,
Jan 30, 2011, 6:56:34 AM1/30/11
to Lift
Hi all!
I'm evaluating Lift and one thing I miss, or cannot see how to
implement, is the ability to have the locale determined from an URI-
pattern. In Struts2 I have:
namespace="/{request_locale}"
So I can have an action (restful) invoked on an URI=/no/companies/
company/1 and it will call my CompanyAction with id=1 and the locale
set to "no". If called from URI=/en/companies/company/1 it will call
the same CompanyAction but the locale will be set to "en".

So my question is: Is it possible to teach Lift to retrieve the locale
based on some uri-pattern, so that it will try to resolve my *.xhtml
after the /{request_locale} part?
/no/index.xhtml
/en/index.xhtml
Should then map to the same templates but with different locale.

David Pollak

unread,
Jan 30, 2011, 12:51:05 PM1/30/11
to lif...@googlegroups.com
I've put together a running example:


The logic file:



--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.




--
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Blog: http://goodstuff.im
Surf the harmonics

Andreas Joseph Krogh

unread,
Jan 30, 2011, 2:18:57 PM1/30/11
to lif...@googlegroups.com
That's great, thanks!
Reply all
Reply to author
Forward
0 new messages