Cleanup previous PR

This commit is contained in:
Kovid Goyal 2025-02-05 20:41:55 +05:30
parent 5f84f8ce33
commit 951a8e58e3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 5 deletions

View File

@ -583,10 +583,12 @@ calendar_start_day_of_week = 'Default'
#: East Asian language to use for transliteration
# Setting this tweak will make calibre use the specified language as the "base"
# language when transliterating East Asian languages to ASCII. This might be
# language when transliterating East Asian languages to English. This might be
# useful if you run calibre in English but want text transliterated to
# Japanese. The valid values are 'ja', 'kr', 'vn', 'zh', and '' (empty string).
# The empty string means use the user interface language as the base language.
# Any value not in the above list will be treated as the empty string.
# Japanese instead of Chinese. The valid values are 'ja' for Japanese, 'kr' for Korean,
# 'vn' for Vietnamese, 'zh' for Chinese.
# Any other value will use the language set in calibre preferences as the base
# language. A base language other than those in the above list causes transliteration
# with a base language of Chinese.
# Example: east_asian_base_language = 'ja'
east_asian_base_language = ''

View File

@ -549,7 +549,7 @@ def get_udc():
if _udc is None:
from calibre.ebooks.unihandecode import Unihandecoder
from calibre.utils.config_base import tweaks
lang = tweaks.get('east_asian_base_language')
lang = tweaks.get('east_asian_base_language', '')
lang = lang if lang in ('ja', 'kr', 'vn', 'zh') else get_lang()
_udc = Unihandecoder(lang=lang)
return _udc