-
-
Notifications
You must be signed in to change notification settings - Fork 517
Open
Description
Lint Translations is showing every single translation, even after builds work correctly and app is correctly configured.
Description
Every single locale defined by rails is being compared with my default locale, even though my translation file only lists 3 locales, and my available_locales are listed explicitly in my app config.
How to reproduce
- Install I18n-js gem
- Create a translation file.
- Create
config/locales/en.ymlconfig/locales/es.ymlandconfig/locales/pl.ymlfiles. In each create a single key: "frontend: { index: "Hello" }" - Run
i18n exportnotice that it works fine, exporting the default rails datetime/time content as well as your custom frontend: key. In the English (or your default locale in this app) translation add an extra key so that it's missing from spanish and polish. - Run
i18n lint:translations > missing_i18n.txtBe sure to redirect because otherwise you lose the history unless your terminal has a lot more lines than mine. - Notice how it lists everything:
Translation File Contents
---
translations:
- file: app/frontend/:locale.i18n.json
patterns:
- "{en,es,pl}.*"
- "!*.faker"
- "!*.administrate"
- "!*.devise"
- "!*.flash"
- "!*.good_job"
- "!*.helpers"
- "!*.i18n_tasks"
- "!*.stringex"
- "!*.views"
- "!*.activerecord"
- "!*.errors"What do you expect
I expect only en, es, and pl to be compared, and further that the ignored patterns from my translations also get ignored in the linter.
What happened instead
130166 line "missing_translations.txt" file with every single locale built into rails listed, and even the pattern keys listed.
Software:
- Gem version: 4.2.3
- Ruby version: ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
Full backtrace
N/A
Metadata
Metadata
Assignees
Labels
No labels