From 6c0f0a41272cc22227b9e696e4db34d415c81acf Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Fri, 16 Aug 2024 11:14:16 +0800
Subject: [PATCH] More fallbacks for Intl.DisplayNames

---
 src/utils/localeCode2Text.jsx | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/utils/localeCode2Text.jsx b/src/utils/localeCode2Text.jsx
index d9a9bd21..93778e3b 100644
--- a/src/utils/localeCode2Text.jsx
+++ b/src/utils/localeCode2Text.jsx
@@ -25,6 +25,10 @@ function _localeCode2Text(code) {
   try {
     const text = IntlDN(locale || i18n.locale).of(code);
     if (text !== code) return text;
+    if (!fallback) {
+      const anotherText = IntlDN(code).of(code);
+      if (anotherText !== code) return anotherText;
+    }
     return fallback || '';
   } catch (e) {
     if (codeMappings[code]) {