i18n-tasks
i18n-tasks copied to clipboard
How to disable normalisation?
I found how to disable wrapping line but I didn't found the config to disable reordering the keys.
There is no such option, but PRs are welcome to add it. I'd call it data.sort_keys_on_write
.
To get you started, see https://github.com/glebm/i18n-tasks/blob/e8db4a195eefd3005f46d2aea6595a5671be8771/lib/i18n/tasks/data/file_formats.rb#L41. It currently always passes true
for the sort parameter.
Is it possible, after having run normalize -p
to put everything back into a single file? sort of a de-normalize -p
or at least something that copies all the keys and injects them back into the main <locale>.yml
?
@ClaudioCarmeli
This should work:
# config/i18n-tasks.yml
data:
write:
- 'config/locales/%{locale}.yml'
i18n-tasks normalize -p
@glebm Thank you so much! I was gonna reply and say "that doesn't work, I've already tried." Still, before commenting, I tried and it worked!
So thank you.
I'll give it a try though I'm not at ease :)