fix(frontend): remove any type from i18n key traversal

This commit is contained in:
Tiago Yamamoto 2025-12-23 18:44:09 -03:00
parent 24ee8d568f
commit 8aada931b5

View file

@ -43,11 +43,11 @@ export function I18nProvider({ children }: { children: ReactNode }) {
const t = useCallback((key: string, params?: Record<string, string | number>): string => {
const keys = key.split('.');
let value: any = dictionaries[locale];
let value: unknown = dictionaries[locale];
for (const k of keys) {
if (value && typeof value === 'object' && k in value) {
value = value[k];
if (value && typeof value === 'object' && value !== null && k in value) {
value = (value as Record<string, unknown>)[k];
} else {
return key; // Return key if not found
}