mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Sort OCR languages when loading them from json
Because now the ocr-languages.json is sorted by tesseract language arg name, we'll want to sort the languages the user sees alphabetically.
This commit is contained in:
parent
58332fdd6e
commit
bc50917362
1 changed files with 2 additions and 1 deletions
|
@ -34,7 +34,8 @@ class DangerzoneCore(object):
|
|||
|
||||
# Languages supported by tesseract
|
||||
with open(get_resource_path("ocr-languages.json"), "r") as f:
|
||||
self.ocr_languages = json.load(f)
|
||||
unsorted_ocr_languages = json.load(f)
|
||||
self.ocr_languages = dict(sorted(unsorted_ocr_languages.items()))
|
||||
|
||||
# Load settings
|
||||
self.settings = Settings(self)
|
||||
|
|
Loading…
Reference in a new issue