From 8539a2169ad0b32b6a1bb209990c4a3b0f065b6c Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Mon, 12 Feb 2024 10:27:06 +0100 Subject: [PATCH 1/2] :bug: - fix: fix a bug that could case an error to be thrown when attempting to use an uncompiled translation --- src/lib/i18n/useIntl.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/i18n/useIntl.tsx b/src/lib/i18n/useIntl.tsx index 5d03293e..d8f2145e 100644 --- a/src/lib/i18n/useIntl.tsx +++ b/src/lib/i18n/useIntl.tsx @@ -82,7 +82,7 @@ const getLocalizedFallbackIntl = ( // messages not loaded. } const message = - messages[descriptor.id || ""].defaultMessage || + messages[descriptor.id || ""]?.defaultMessage || descriptor.defaultMessage; return formatMessage(message, context); }, From 257ccfd37db3f784cae9bb645d24841b758eec78 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Mon, 12 Feb 2024 10:30:10 +0100 Subject: [PATCH 2/2] :pencil2: - docs: fix typo in docstring in useIntl.tsx --- src/lib/i18n/useIntl.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/i18n/useIntl.tsx b/src/lib/i18n/useIntl.tsx index d8f2145e..abccaf7a 100644 --- a/src/lib/i18n/useIntl.tsx +++ b/src/lib/i18n/useIntl.tsx @@ -8,10 +8,10 @@ import { formatMessage } from "./formatmessage"; This UI library needs to support the following scenarios: - - An application with extensive Internationalization support + - An application with extensive internationalization support (using react-intl). - - An application with basic Internationalization using translated labels + - An application with basic internationalization using translated labels passed as props. - No internalisation (default messages only).