We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a80e6a commit 82882cbCopy full SHA for 82882cb
src/zimscraperlib/i18n.py
@@ -111,12 +111,9 @@ def replace_types(new_type: str) -> str:
111
)
112
lang_data.update({"english": isolang.name, "iso_types": iso_types})
113
114
- if isolang.macro():
115
- return (
116
- lang_data,
117
- get_iso_lang_data(isolang.macro().name)[0],
118
- ) # first item in the returned tuple
119
- return lang_data, None
+ # first item in the returned tuple
+ macro = isolang.macro()
+ return (lang_data, get_iso_lang_data(macro.name)[0] if macro else None)
120
121
122
def find_language_names(query: str, lang_data: Lang | None = None) -> tuple[str, str]:
0 commit comments