Open jensb opened 13 years ago
I had the same problem - but it can be solved easily with a redirect call. Redirect all stuff to the new place. You can use parameters in rails redirects, so you can redirect all contents easily.
The issue is not really solved with a redirect. It works for users, but when pages are indexed by search engines, this can destroy your ranking (think "duplicate content"). Pages which don't exist or contain duplicate content should return 404.
How did you solve this?
I see your point. What is the perfect solution to this?
This is simple: When adding translated routes, remove the original routes from the routing table.
However, I do not know how to do this in i18n-routing ... :)
I also had this problem, the solution I found is to simply add a constraint that checks the locale of the request vs the current locale at the time the definition is executed:
localized([:es, :ca, :en]) do
scope "/:i18n_locale", :constraints => {:i18n_locale => I18n.locale} do
end
end
Then make sure you set the locale looking first for the i18n_locale attribute. This is what I have:
def set_locale
I18n.locale = params[:i18n_locale] || params[:locale]
end
Because I only have a subset of all my routes translated.
Hello,
when I use your plugin, both the original and the translated routes exist. This is a problem because it creates duplicate content, which is bad for SEO.
Is it possible to have only the translated routes, and remove the original routes, when the locale is set to a language other than the default?
Thanks!