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

setup of ignore_missing only for non base_locale locales

Open jhovad opened this issue 4 years ago • 4 comments

I would like setup following:

  • I have 3 user interfaces in my app: Admin, Teacher, Client
  • Admin and Teacher is English only
  • Client is multiple languages

I would like to run "i18n-tasks missing" so that:

  • for "en" locale it tooks everything into the consideration (all interfaces have to be English)
  • for other locales ("de", "es", etc...) it ignores missing with following setup:
  ignore_missing:
  - 'admin.*'
  - 'admin_mailer.*'
  - 'teacher.*'
  - 'teacher_mailer.*'

I don't need translations of admin* and teacher* in other then English language.

Thank you very much for any hint how to automate this task.

jhovad avatar Dec 29 '19 12:12 jhovad

Or is it possible to exclude a complete translation file?

afdev82 avatar Jan 18 '21 09:01 afdev82

We need to ignore a specific language for pluralization.

i.e. Vietnamese doesn't have a concept of one

en:
  errors:
    record_count:
      one: there is one record
      other: there are %{count} records

In VI or ID we don't have one. i18n-tasks missing always complains about the one key missing from VI or ID.yml files.

nitsujri avatar Jun 04 '21 09:06 nitsujri

I believe this is supported as follows:

ignore_missing:
  de:
    - 'admin.*'
    - 'admin_mailer.*'
    - 'teacher.*'
    - 'teacher_mailer.*'
  es:
    - 'admin.*'
    - 'admin_mailer.*'
    - 'teacher.*'
    - 'teacher_mailer.*'
...

And if they're all the same, you should be able to use YAML inheritance, something like:

ignore_missing:
  defaults: &DEFAULT_IGNORES
    - 'admin.*'
    - 'admin_mailer.*'
    - 'teacher.*'
    - 'teacher_mailer.*'
  es:
    <<: *DEFAULT_IGNORES
  de:
    <<: *DEFAULT_IGNORES
...

mltsy avatar Jun 30 '22 22:06 mltsy

How to ignore folders that includes "olds" (e.g. app/views/items/old/index.html.erb) ?

SOLVED

exclude:
    - "*/old/*.html.erb"

leoplct avatar Feb 11 '23 11:02 leoplct