Fixes language code checks around two part languages

This commit is contained in:
Trenton Holmes
2022-12-04 08:44:35 -08:00
committed by Trenton H
parent 0e8265f1ae
commit 55ef0d4a1b
2 changed files with 38 additions and 2 deletions

View File

@@ -16,8 +16,7 @@ def get_tesseract_langs():
# Decode bytes to string, split on newlines, trim out the header
proc_lines = proc.stdout.decode("utf8", errors="ignore").strip().split("\n")[1:]
# Replace _ with - to convert two part languages to the expected code
return [x.replace("_", "-") for x in proc_lines]
return [x.strip() for x in proc_lines]
@register()