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("xxx-6Vbaijze9KM@public.gmane.org",
"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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---