It’s a very old gem that was created 13 years ago for Rails 2.2, but it should still work for recent versions.
Just bundle this and run rails g i18n fr, then it will generate the thing that you want (and maybe a little bit more extra things that you didn’t expect).
Wow thank you @Akira_Matsuda that’s what I’m looking for.
I’m a bit surprised that the rails generator doesn’t generate those entries.
On every new rails project I have to lookup the documentation to create the entries.
In most cases, it would be redundant because I try to choose attribute names that are meaningful. In the case where the name needs to be localized (because I chose a bad name or I because need to localize immediately to multiple languages), I’d still need to edit the file. Generating the entry doesn’t save me very much.
I’d rather have a helper that generates all the stub entries on demand at the moment that I am ready to localize.