Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use hints with dynamic keys creates a missing key #482

Open
JordanMooreNZ opened this issue Nov 3, 2022 · 1 comment
Open

Use hints with dynamic keys creates a missing key #482

JordanMooreNZ opened this issue Nov 3, 2022 · 1 comment

Comments

@JordanMooreNZ
Copy link

Using a dynamic key in a use hint works for addressing dynamic keys for the unused task but it creates a missing key for the missing task e.g.

    # i18n-tasks-use t('enumerations.checks.#{foo}.#{bar}')
    # i18n-tasks-use t('enumerations.test.#{foobar}')

running i18n-tasks missing results in

Missing translations (2) | i18n-tasks v1.0.12
+--------+-----------------------------------+---------------------------------------------------+
| Locale | Key                               | Value in other locales or source                  |
+--------+-----------------------------------+---------------------------------------------------+
|  all   | enumerations.checks.#{foo}.#{bar} | app/test_file.rb:204                              |
|  all   | enumerations.test.#{foobar}       | app/test_file.rb:203                              |
+--------+-----------------------------------+---------------------------------------------------+

This is not resolved by adding them to the ignore_missing in the config either:

## Do not consider these keys missing:
ignore_missing:
  - enumerations.checks.#{foo}.#{bar}
  - enumerations.test.#{foobar}

Ideally dynamic keys used in the use hints should not count as a separate missing translation key, and if they do count towards it how can we tell i18n-tasks to ignore them for the missing check?

@davidwessman
Copy link
Collaborator

The i18n-tasks-use is not that advanced I think, so for now you need to add all possible options that can be used, without dynamic keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants