diff options
Diffstat (limited to 'src/i18n')
| -rw-r--r-- | src/i18n/translate.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/i18n/translate.ts b/src/i18n/translate.ts index 0366798..09e227c 100644 --- a/src/i18n/translate.ts +++ b/src/i18n/translate.ts @@ -14,10 +14,11 @@ type TranslationsDictionaryWith< }>; export default function (locale: Locale) { - return function <Key extends string | number, ParamsHash extends object>( - dict: TranslationsDictionaryWith<Key, ParamsHash>, - params: { key: Key } & ParamsHash - ) { + return function < + Key extends string | number, + ParamsHash extends object, + Dict extends TranslationsDictionaryWith<Key, ParamsHash>, + >(dict: Dict, params: { key: Key } & ParamsHash) { if (!(params.key in dict)) { throw new Error(` Could not find translation for key '${params.key}'. Available keys were: |
