Gleb Mazovetskiy

Results 244 comments of Gleb Mazovetskiy

This an internal error, i.e. a bug in i18n-tasks. `i18n-tasks` should handle invalid data gracefully. Do you have an example of a file that results in this error being thrown?

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

@ClaudioCarmeli This should work: ```yaml # config/i18n-tasks.yml data: write: - 'config/locales/%{locale}.yml' ``` ``` i18n-tasks normalize -p ```

The translator only handles arrays and strings at the moment If you'd like to attempt a fix by adding Hash support, the code is here https://github.com/glebm/i18n-tasks/blob/a2adc3104e87a2b58a09c3e416f5e1151c4c7aca/lib/i18n/tasks/translators/base_translator.rb#L64-L94

You can get it like this, should be accurate enough for an estimate: ```bash i18n-tasks data -fyaml | cut -d: -f1 --complement | wc -w ```

Duplicate translations are common when they come from `data.external`. If we want to print a warning, we should print it only for duplicate translations within `data.read`, which may be trickier....

Perhaps there is a YAML parser mode that can round-trip this, but I am not aware of one. Related [discussion on StackOverflow](http://stackoverflow.com/questions/6940775/round-trip-parsing-of-data-structure-format-yaml-or-whatnot-preserving-comment).

@bertBruynooghe Yes, it's the same thing, the YAML parser can't round-trip this. But in your case you should just use reference keys instead, e.g.: ```yaml en: some_other_key: :insulin_dose.dose ```

@schepens83 You may need to use the main branch instead of the latest release for this to work

I've just released v0.9.35 from the current main