fix: support non-ascii languages in the spectrogram
This commit is contained in:
@@ -12,6 +12,22 @@ _settings = None
|
||||
|
||||
DB_PATH = os.path.expanduser('~/BirdNET-Pi/scripts/birds.db')
|
||||
ANALYZING_NOW = os.path.expanduser('~/BirdSongs/StreamData/analyzing_now.txt')
|
||||
FONT_DIR = os.path.expanduser('~/BirdNET-Pi/homepage/static')
|
||||
|
||||
|
||||
def get_font():
|
||||
conf = get_settings()
|
||||
if conf['DATABASE_LANG'] == 'ar':
|
||||
ret = {'font.family': 'Noto Sans Arabic', 'path': os.path.join(FONT_DIR, 'NotoSansArabic-Regular.ttf')}
|
||||
elif conf['DATABASE_LANG'] in ['ja', 'zh']:
|
||||
ret = {'font.family': 'Noto Sans JP', 'path': os.path.join(FONT_DIR, 'NotoSansJP-Regular.ttf')}
|
||||
elif conf['DATABASE_LANG'] == 'ko':
|
||||
ret = {'font.family': 'Noto Sans KR', 'path': os.path.join(FONT_DIR, 'NotoSansKR-Regular.ttf')}
|
||||
elif conf['DATABASE_LANG'] == 'th':
|
||||
ret = {'font.family': 'Noto Sans Thai', 'path': os.path.join(FONT_DIR, 'NotoSansThai-Regular.ttf')}
|
||||
else:
|
||||
ret = {'font.family': 'Roboto Flex', 'path': os.path.join(FONT_DIR, 'RobotoFlex-Regular.ttf')}
|
||||
return ret
|
||||
|
||||
|
||||
class PHPConfigParser(ConfigParser):
|
||||
|
||||
Reference in New Issue
Block a user