end
def set_locale
- request.compatible_language_from(I18n.available_locales)
+ if @user
+ if !@user.languages.empty?
+ request.user_preferred_languages = @user.languages
+ elsif !request.user_preferred_languages.empty?
+ @user.languages = request.user_preferred_languages
+ @user.save
+ end
+ end
+
+ I18n.locale = request.compatible_language_from(I18n.available_locales)
end
def api_call_handle_error