From 47e6e4c25a35cb26b986acca636c2f9384bd32e0 Mon Sep 17 00:00:00 2001 From: Kewell Date: Tue, 17 Oct 2023 16:29:43 +0800 Subject: [PATCH] Fixed a bug checking translated string keys (#2082) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed a bug checking translated string keys Suppress the following warning message in your browser. ``` Language zh-cn: missing messages for keys: locale label messages ``` ### Change Type - [x] `patch` — Bug fix - [ ] `minor` — New feature - [ ] `major` — Breaking change - [ ] `dependencies` — Changes to package dependencies[^1] - [ ] `documentation` — Changes to the documentation only[^2] - [ ] `tests` — Changes to any test code only[^2] - [ ] `internal` — Any other changes that don't affect the published package[^2] - [ ] I don't know [^1]: publishes a `patch` release, for devDependencies use `internal` [^2]: will not publish a new version --- packages/tldraw/src/lib/ui/hooks/useTranslation/translations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tldraw/src/lib/ui/hooks/useTranslation/translations.ts b/packages/tldraw/src/lib/ui/hooks/useTranslation/translations.ts index 5c4a345f0..facbc4108 100644 --- a/packages/tldraw/src/lib/ui/hooks/useTranslation/translations.ts +++ b/packages/tldraw/src/lib/ui/hooks/useTranslation/translations.ts @@ -56,7 +56,7 @@ export async function fetchTranslation( const missing: string[] = [] - for (const key in EN_TRANSLATION) { + for (const key in EN_TRANSLATION.messages) { if (!messages[key as TLUiTranslationKey]) { missing.push(key) }