You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an application exceeds a certain amount of complexity, dealing with I18n keys within just a few files becomes quite unhandy. For that reason the official Rails guide recommends a way to organize the locale files for an affected application (http://guides.rubyonrails.org/i18n.html#organization-of-locale-files).
I played around a bit (like trial-and-error) with the data-write settings within the config file. But to me it seems like it isn't part of the scope yet to just read the original files, decide which keys are missing in the target locale and create the corresponding files and/or keys on the respective folder level.
Is there any possibility to achieve this? Do you think that this is a use case worth considering in the i18n-tasks workflow?
To be clear: Reading the data from this custom structure is easily done - obviously.
Your use case only explicit routing is supported, but it is quite flexible. See data.write section in example in the Readme:
# config/i18n-tasks.yml
data:
write:
# store sorcery and simple_form keys in the respective files:
- ['{sorcery,simple_form}.*', 'config/locales/\1.%{locale}.yml']
# write every key namespace to its own file:
- ['{:}.*', 'config/locales/\1.%{locale}.yml']
However, automatically detecting structure would be super cool. To begin with we could make it a separate task, something like:
I refactored i18n-tasks to use real trees internally, as opposed to nested hashes.
This, in turn, allowed for a very easy conservative router implementation.
Try it out by switching to master and changing the config to use it:
If an application exceeds a certain amount of complexity, dealing with I18n keys within just a few files becomes quite unhandy. For that reason the official Rails guide recommends a way to organize the locale files for an affected application (http://guides.rubyonrails.org/i18n.html#organization-of-locale-files).
I played around a bit (like trial-and-error) with the data-write settings within the config file. But to me it seems like it isn't part of the scope yet to just read the original files, decide which keys are missing in the target locale and create the corresponding files and/or keys on the respective folder level.
Is there any possibility to achieve this? Do you think that this is a use case worth considering in the i18n-tasks workflow?
To be clear: Reading the data from this custom structure is easily done - obviously.
The text was updated successfully, but these errors were encountered: