Rails 2.2.0 and i18n issue / caching problem


#1

I have some issues with the new great i18n features

Everytime I make some chages in my .yml file I need to restart script/
server
to see the changes. It seems to be not a browser caching issue.

/lib/local/de.yml

“de”:
txt:
menue:
link: “Bitte folgen Sie diesem Link {{link1}}”

…/views/home/index.html.erb

Link: <%= I18n.t ‘txt.menue.link’, :link1 => mail_to(“removed_email_address@domain.invalid”,
“xxx”) %>

…/controllers/application.rb:

def set_locale
I18n.locale = extract_locale_from_params ||
extract_locale_from_uri || ‘de’
logger.debug “Locale set to ‘#{I18n.locale}’”
end

def available_locales
AVAILABLE_LOCALES # See config/initializers/locales.rb
end

def current_locale?(l)
l == I18n.locale
end

def current_page_path(options={})
url_for( {:controller => self.controller_name, :action =>
self.action_name}.merge(options) )
end

private

def extract_locale_from_params
(available_locales.include? params[:locale]) ? params[:locale] :
nil
end

def extract_locale_from_uri
parsed_locale = URI.parse(request.url).host.split(’.’).last.gsub(/
com/, ‘de’)
(available_locales.include? parsed_locale) ? parsed_locale : nil
end