fix(frontend): remove any type from i18n key traversal
This commit is contained in:
parent
24ee8d568f
commit
8aada931b5
1 changed files with 3 additions and 3 deletions
|
|
@ -43,11 +43,11 @@ export function I18nProvider({ children }: { children: ReactNode }) {
|
||||||
|
|
||||||
const t = useCallback((key: string, params?: Record<string, string | number>): string => {
|
const t = useCallback((key: string, params?: Record<string, string | number>): string => {
|
||||||
const keys = key.split('.');
|
const keys = key.split('.');
|
||||||
let value: any = dictionaries[locale];
|
let value: unknown = dictionaries[locale];
|
||||||
|
|
||||||
for (const k of keys) {
|
for (const k of keys) {
|
||||||
if (value && typeof value === 'object' && k in value) {
|
if (value && typeof value === 'object' && value !== null && k in value) {
|
||||||
value = value[k];
|
value = (value as Record<string, unknown>)[k];
|
||||||
} else {
|
} else {
|
||||||
return key; // Return key if not found
|
return key; // Return key if not found
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue