✨(react) fix translations and add missing translations
This commit improves the translations method to handle undefined values gracefully and adds several missing translations for modals in the French locale.
This commit is contained in:
@@ -47,7 +47,10 @@ const findTranslation = (
|
||||
locale: TranslationSet,
|
||||
): string | undefined => {
|
||||
const [namespace, ...keys] = key.split(".");
|
||||
return keys.reduce((acc, subKey) => acc[subKey], (locale as any)[namespace]);
|
||||
return keys.reduce(
|
||||
(acc, subKey) => acc?.[subKey],
|
||||
(locale as any)[namespace],
|
||||
);
|
||||
};
|
||||
|
||||
export const CunninghamProvider = ({
|
||||
|
||||
Reference in New Issue
Block a user