From ac8a4c7fbff4c2673e9ff04cc02852e1b99bf3df Mon Sep 17 00:00:00 2001 From: Lim Chee Aun <cheeaun@gmail.com> Date: Mon, 14 Aug 2023 18:03:05 +0800 Subject: [PATCH] Instead of return false, return the default locale arg --- src/utils/locale-match.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/locale-match.jsx b/src/utils/locale-match.jsx index 8c46ec65..e901e9f2 100644 --- a/src/utils/locale-match.jsx +++ b/src/utils/locale-match.jsx @@ -6,7 +6,8 @@ function _localeMatch(...args) { try { return match(...args); } catch (e) { - return false; + const defaultLocale = args[2]; + return defaultLocale || false; } } const localeMatch = mem(_localeMatch, {