From b502805755ff200ae4fbaa997382f30b33ed5bbf Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Tue, 30 Apr 2024 09:46:31 +0800 Subject: [PATCH] fix(TDS-7339/Date): Language switch does not update Date Field error messages (#5296) --- .changeset/slimy-tigers-bow.md | 5 +++++ .../components/src/DateTimePickers/shared/error-messages.js | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .changeset/slimy-tigers-bow.md diff --git a/.changeset/slimy-tigers-bow.md b/.changeset/slimy-tigers-bow.md new file mode 100644 index 0000000000..4b8f8d416a --- /dev/null +++ b/.changeset/slimy-tigers-bow.md @@ -0,0 +1,5 @@ +--- +"@talend/react-components": patch +--- + +Fix translation for date range diff --git a/packages/components/src/DateTimePickers/shared/error-messages.js b/packages/components/src/DateTimePickers/shared/error-messages.js index 8493eb2bd8..36a97580da 100644 --- a/packages/components/src/DateTimePickers/shared/error-messages.js +++ b/packages/components/src/DateTimePickers/shared/error-messages.js @@ -1,8 +1,7 @@ import getDefaultT from '../../translate'; -const t = getDefaultT(); - export default function getErrorMessage(key) { + const t = getDefaultT(); switch (key) { case 'INVALID_HOUR_EMPTY': return t('INVALID_HOUR_EMPTY', { defaultValue: 'Hour is required' });