Support for ISO 639-1 - 15924 codes

This commit is contained in:
Piero Toffanin 2025-04-07 23:28:34 -04:00
parent 4fe84200fb
commit 4e86bfa991
4 changed files with 48 additions and 19 deletions

View file

@ -21,9 +21,11 @@ def check_lang(langcodes, lang):
def normalized_lang_code(lang):
code = lang.lang
# Handle zh-cn
if code.startswith("zh"):
# Handle Chinese
if code == "zh-cn":
code = "zh"
elif code == "zh-tw":
code = "zt"
return code
class Detector: