# Rails 2.2.0 and i18n issue / caching problem

**URL:** <https://www.ruby-forum.com/t/rails-2-2-0-and-i18n-issue-caching-problem/151763>\
**Category:** Rails\
**Created:** [October 25, 2008, 7:12am UTC](https://www.ruby-forum.com/t/rails-2-2-0-and-i18n-issue-caching-problem/151763 "2008-10-25T07:12:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jawosis](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f04885/32.png) [@jawosis](https://www.ruby-forum.com/u/jawosis)\
**Post date:** [October 25, 2008, 7:12am UTC](https://www.ruby-forum.com/t/rails-2-2-0-and-i18n-issue-caching-problem/151763/1 "2008-10-25T07:12:04Z")

</div>

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
