I'm about to start adding I18n support for a Rails app I'm currently working on. In the past I have set the locale value from the URL. I just was wondering how bad practice it'd be to persist the locale?
So instead of something like this:
I18n.locale = params[:locale] || I18n.default_locale
Do something like
I18n.locale = current_user.try(:locale) || I18n.default_locale
It looks like FB persists the locale, what are the trade-offs of this schema? how might this affect SEO stuff?
I've faced these issues and ended up using this strategy:
If locale is not present in URL, try (in order):
Hope that helps; let me know if you'd like any points elaborated on.