Closed nicoarbogast closed 12 years ago
Are you sure you want this url structure? You'll get some duplicate content on: /en/translated-products - /products and you can't do a permanent redirection header on /products to avoid it as it changes everytime depending on the client language.
Hi,
Thank you for your reply. Actually the structure I get is the following:
/raw_resource_name /en/translated_route_for_resource_in_en /fr/translated_route_for_resource_in_fr /es/translated_route_for_resource_in_es ...
Then I redirect /raw_resource_name to translated routes if ( !request.xhr? + whatever conditions )
I have an app in prod with this config, with no duplicate and no issue with redirections for the moment.
I like it because it allows me to build ajax urls, and basic api calls using the raw_resource_name. (Another solution would be to use I18n in my javascript for building request urls, I agree, but I find it simpler with this method).
Please tell me if you think there are better ways of designing this. Thanx Nico
Will be on next release on a few hours, make basic testing, if you find any problem tell me.
Thanks a lot ! Tested and seems to be working great !
I added this option to allow the following routes structure
default_locale = :en
/en/translated-products /fr/translated-produits /products
I used this config in production in a Rails 3.1 project and just updated it to fit 3.2 requirements.