Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 4th, 2012  |  syntax: None  |  size: 0.51 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to manage Rails 2.3.x i18n locales programatically?
  2. I18n.add_locale_key("en", "application.messages.submit_message", "Submit message!")
  3. I18n.add_locale_key("es", "application.messages.submit_message", "Enviar mensaje!")
  4.  
  5. I18n.remove_locale_key("en", "application.messages.submit_message")
  6. I18n.remove_locale_key("es", "application.messages.submit_message")
  7.        
  8. >> I18n.backend.store_translations :en, :hello_world => "Hello, world."
  9. => {:hello_world=>"Hello, world."}
  10. >> I18n.t :hello_world
  11. => "Hello, world."