i18n-tasks icon indicating copy to clipboard operation
i18n-tasks copied to clipboard

How to disable normalisation?

Open AdrienGiboire opened this issue 7 years ago • 5 comments

I found how to disable wrapping line but I didn't found the config to disable reordering the keys.

AdrienGiboire avatar Dec 23 '16 10:12 AdrienGiboire

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.

glebm avatar Dec 23 '16 12:12 glebm

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 ?

ghost avatar Feb 20 '17 21:02 ghost

@ClaudioCarmeli

This should work:

# config/i18n-tasks.yml
data:
  write:
  - 'config/locales/%{locale}.yml'
i18n-tasks normalize -p

glebm avatar Feb 20 '17 22:02 glebm

@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.

ghost avatar Feb 23 '17 18:02 ghost

I'll give it a try though I'm not at ease :)

AdrienGiboire avatar Feb 28 '17 09:02 AdrienGiboire