[Catalyst] Multi-language and REST
geir at fandom.no
Mon Apr 28 15:17:34 BST 2008
On 25 Apr 2008, at 14:44 , Ian Docherty wrote:
> I have been pondering how to take an existing Catalyst application
> and make it multi-lingual.
> I would prefer to use a RESTful method, so this would translate /foo/
> bar to /en/foo/bar or /fr/foo/bar (for English and French
> The problem as I see it is how to do this. I don't want to move all
> my controllers, e.g. MyApp::Controller::Foo::Bar to
> What other alternatives are there?
- Use two different subdomains (en.domain.com and fr.domain.com)
- Send a cookie header (which arguably is easier for the user than
messing with Accept-Language)
- Send both languages in the HTML (encoded with lang="xxx"), but show
only one using CSS
The main question is to decide whether the language should be
specified in the URL or not. There are valid reasons for saying that
the French text is not the same document as the English text, hence
they should have separate URLs (one such example is having both
versions indexed in Google).
More information about the Catalyst