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

Fixes usage report for non-missing derived keys #957

Closed

Conversation

mkevinosullivan
Copy link
Contributor

Derived keys (e.g., such as plurals) were being miscategorised as missing in the usage report.

This commit checks if keys derived from those found in the missing list (keys that are in use but considered "not defined") are included in the list of idle keys (keys defined but not considered in use), indicating that they are indeed defined and in use.

Fixes #953
NOTE branch is based on kos/add_i18next_shopify_framework, so #949 needs to be merged first.

Background/context:

Assume a locale setup of

{
  "count": {
    "one": "{count} message",
    "other": "{count} messages",
  }
}

In a nested key scenario, where we use just the "count" part as the key in, say, t("count", { count: 1}), "count" is considered "missing" (in use, but not defined") and "count.one" and "count.other" are considered "idle" (defined but not in use).

This commit adds the `supportAutoExtraction` array of supported formats
and the `detectHardStrings` method from `GeneralFramework` to enable
hard-coded string extraction for react-i18next framework, without
needing the "general" framework to be enabled/loaded in the
`.vscode/settings.json` file.
This commit adds the i18next-shopify framework to the list of supported
frameworks. It is an extension of the React i18next framework, with some
configuration changes.

Also add i18next-shopify example app, including a pluralization example.
Derived keys (e.g., such as plurals) were being miscategorised as
missing in the usage report.  This commit checks if keys derived from
those found in the missing list (keys that are in use but considered
"not defined") are included in the list of idle keys (keys defined but
not considered in use), indicating that they are indeed defined and in
use.

Fixes lokalise#953
@terales
Copy link
Collaborator

terales commented Jul 11, 2023

Merged within #970

@terales terales closed this Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

For nested pluralization keys, i18n-ally usage report inaccurately indicates unused/not found keys
2 participants