mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-05-14 14:02:52 +00:00
Support for ISO 639-1 - 15924 codes
This commit is contained in:
parent
4fe84200fb
commit
4e86bfa991
4 changed files with 48 additions and 19 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue