lokalise / lokalise-cli-2-go

Lokalise CLI v2
Other
108 stars 52 forks source link

Rails i18n yaml with nested module plurals are parsed as json #63

Closed mattboldt closed 3 years ago

mattboldt commented 3 years ago

I have a yaml structure like this:

fr:
  activerecord:
    models:
      events/program:
        one: Programme
        other: Programmes

And when uploaded to Lokalise, it's stored in json instead of the plural being detected:

{"one":"Programme","other":"Programmes"}

I have other normal plurals (not nested in a module using the module/class_name: syntax) that are imported just fine, so this seems like an issue with nesting.

Here's the command I'm running:

lokalise2 --config #{CONFIG_PATH} file upload \
  --distinguish-by-file \
  --include-path \
  --convert-placeholders=false \
  --replace-modified \
  --detect-icu-plurals \
  --file 'locales/fr.yml' \
  --lang-iso fr
mattboldt commented 3 years ago

Whoops, nevermind. It only did that when my english (base language) file did not have plural values for the same key. Works as expected once I added them to en.yml.