Skip to content

Commit 7801059

Browse files
committed
only fetch language data from Babel if it is missing
1 parent 13def7b commit 7801059

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cc_legal_tools/settings/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
"name": "Northern Sotho",
235235
"name_local": "Sesotho sa Leboa",
236236
}
237-
# Aranese (an Occitan variant)
237+
# Aranese (an Occitan variant, CLDR: oc-ES)
238238
LANG_INFO["oc-aranes"] = {
239239
"bidi": False,
240240
"code": "oc-aranes",

i18n/utils.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,12 @@ def update_lang_info(language_code):
343343
if language_code not in LANG_INFO:
344344
LANG_INFO[language_code] = {}
345345
lang_info = LANG_INFO[language_code]
346-
lang_info["name"] = locale.get_display_name("en")
347-
lang_info["name_local"] = locale.get_display_name(locale_name)
348-
lang_info["bidi"] = order_to_bidi[locale.character_order]
346+
if not lang_info.get("name"):
347+
lang_info["name"] = locale.get_display_name("en")
348+
if not lang_info.get("name_local"):
349+
lang_info["name_local"] = locale.get_display_name(locale_name)
350+
if not lang_info.get("bidi"):
351+
lang_info["bidi"] = order_to_bidi[locale.character_order]
349352
except UnknownLocaleError:
350353
pass
351354

0 commit comments

Comments
 (0)