This commit is contained in:
Kovid Goyal 2025-02-05 20:38:08 +05:30
commit 5f84f8ce33
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 14 additions and 1 deletions

View File

@ -580,3 +580,13 @@ openers_by_scheme = {}
# It must be one of the values Default, Sunday, Monday, Tuesday, Wednesday, # It must be one of the values Default, Sunday, Monday, Tuesday, Wednesday,
# Thursday, Friday, or Saturday, all in English, spelled exactly as shown. # Thursday, Friday, or Saturday, all in English, spelled exactly as shown.
calendar_start_day_of_week = 'Default' 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
# 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.
# Example: east_asian_base_language = 'ja'
east_asian_base_language = ''

View File

@ -548,7 +548,10 @@ def get_udc():
global _udc global _udc
if _udc is None: if _udc is None:
from calibre.ebooks.unihandecode import Unihandecoder from calibre.ebooks.unihandecode import Unihandecoder
_udc = Unihandecoder(lang=get_lang()) from calibre.utils.config_base import tweaks
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 return _udc