From f17eb379aca36d391e1e50d79b61172b6c42cba7 Mon Sep 17 00:00:00 2001 From: Michcio Date: Sun, 25 Sep 2022 16:05:22 +0200 Subject: [PATCH] Provide intermediate type to calm typechecker down in i18n --- packages/backend/src/misc/i18n.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/misc/i18n.ts b/packages/backend/src/misc/i18n.ts index 4fa398763..9a18cf449 100644 --- a/packages/backend/src/misc/i18n.ts +++ b/packages/backend/src/misc/i18n.ts @@ -13,7 +13,7 @@ export class I18n> { // なるべくこのメソッド使うよりもlocale直接参照の方がvueのキャッシュ効いてパフォーマンスが良いかも public t(key: string, args?: Record): string { try { - let str = key.split('.').reduce((o, i) => o[i], this.locale) as string; + let str = key.split('.').reduce((o, i) => o[i] as Record | string, this.locale) as string; if (args) { for (const [k, v] of Object.entries(args)) {