-
Notifications
You must be signed in to change notification settings - Fork 54
Description
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.
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 -
theme-tools/packages/theme-check-common/src/checks/matching-translations/index.ts
Line 51 in 90577cd
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.');