Translator: add "Translate from book language" option (#8094)

When enabled, if the book has some supported language tag
in its metadata, use it as the source language. Otherwise,
fallback to the current settings (auto-detect or selected
source language).
This commit is contained in:
poire-z
2021-08-18 00:42:14 +02:00
committed by GitHub
parent 4e65b74b73
commit 1a12e8555e
2 changed files with 70 additions and 4 deletions

View File

@@ -113,6 +113,8 @@ for __, v in ipairs(LANGUAGES) do
ReaderTypography.HYPH_DICT_NAME_TO_LANG_NAME_TAG[hyph_filename] = { lang_name, lang_tag }
end
end
-- Make lang aliases available to other modules (can be used by Translator)
ReaderTypography.LANG_ALIAS_TO_LANG_TAG = LANG_ALIAS_TO_LANG_TAG
function ReaderTypography:init()
self.menu_table = {}