Fix TypeScript issue
This commit is contained in:
parent
7f1bb68adb
commit
fc8b44849c
1 changed files with 5 additions and 1 deletions
|
@ -7,7 +7,11 @@ export function useTranslations(language: string) {
|
||||||
return function t(
|
return function t(
|
||||||
key: keyof (typeof strings)[typeof defaultLanguage],
|
key: keyof (typeof strings)[typeof defaultLanguage],
|
||||||
): string {
|
): string {
|
||||||
return strings[language]![key] || strings[defaultLanguage]![key] || "";
|
return (
|
||||||
|
strings[language as keyof typeof strings][key] ||
|
||||||
|
strings[defaultLanguage][key] ||
|
||||||
|
""
|
||||||
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue