Skip to content

[Theme Check] MatchingTranslations rule handling Customer Accounts translations incorrectly #930

@jamespeilow

Description

@jamespeilow

Describe the bug

When running shopify theme check, the MatchingTranslations reports errors for the customer_accounts. namespaced translations when a merchant has changed one or more of the Customer Accounts translations.

When the merchant changes one of the Customer Accounts translations, the changed string gets added to the theme locale JSON file under the customer_accounts namespace. However only the changed line gets added and only to the changed language's locale JSON file, causing Theme Check to then report the MatchingTranslations error as the translation is missing from the other locales.

The customer_accounts. translations all exist, and are visible in the Admin under in Languages and in Translate & Adapt, but they don't exist in a themes locales JSON files. This is the same behaviour as how Checkout translations are handled.

Expected behaviour

The MatchingTranslations rule should ignore translations that start with customer_accounts., similarly to how it ignores translations starting shopify.

Actual behaviour

The MatchingTranslations rule reports missing translations when a customer_accounts. translation does not appear in every locale file.

Image

Additional context

This issue isn't an problem with Checkout translations, as these get added under the shopify namespace, which is excluded by the isShopifyPath check in the MatchingTranslations rule -

const isShopifyPath = (path: string) => path.startsWith('shopify.');

Updating that function to also return true for paths starting customer_accounts. would fix the issue:

    const isShopifyPath = (path: string) => path.startsWith('shopify.') || path.startsWith('customer_accounts.');

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions