I started populating an en yaml file in Rails and I can already tell it will get messy and out of hand before too long. Is there a convention to keeping this file organized?
Coming several years after the battle, but here is a (somewhat totally) different answer.
To begin with, I do not like the standard t('.xxx')
style with the default namespace based on the file structure. I also don't really like the categorisation of translations depending on the DOM structure. While this is a nice approach for very structured translations, it is often repetitive, and not very intuitive.
I'd rather regroup my translations into more useful categories, so as to make it easier for my translators, because they can work on concrete themes, rather than some weird styles (some translators do not even know what MVC means)
so my translation file is structured like this
fr:
theme1:
theme11:
translationxxx: blabla
theme2:
translationyyy: blabla
Depending on the needs, the "themes" can be a model, a more abstract context, etc. that is the most intuitive for the translators.
Because this would be a hassle to write everytime the scope in my views, I have added some convenience methods in my helpers to have a stack based translation context.
t_scope([new_scope]
and pop_t
t
helper to use the last scope of the stackThe code for the translation scoping methods is available in that answer