List Rails I18n strings with full keys
internationalization, ruby-on-rails, yaml
Solution
Once loaded into memory it's just a big Hash, which you can format any way you want. to access it you can do this:
I18n.backend.send(:translations)[:en]
To get a list of available translations (created by you or maybe by plugins and gems)
I18n.available_locales
Problem
I'd like to be able to generate a complete list of all the I18n keys and values for a locale including the full keys. In other words if I have these files: `config/locales/en.yml` ``` en: greeting: polite: "Good evening" informal: "What's up?" ``` `config/locales/second.en.yml` ``` en: farewell: polite: "Goodbye" informal: "Later" ``` I want the following output: ``` greeting.polite: "Good evening" greeting.informal: "What's up?" farewell.polite: "Goodbye" farewell.informal: "Later" ``` How do I do this?