mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-03-01 07:03:55 +08:00
14 lines
448 B
Python
14 lines
448 B
Python
import gettext
|
|
from common.hardware import EON
|
|
from common.hardware_android import getprop
|
|
|
|
locale_dir = '/data/openpilot/selfdrive/assets/locales'
|
|
supported_language = ['en-US', 'zh-TW', 'zh-CN', 'ja-JP', 'ko-KR']
|
|
|
|
def get_locale():
|
|
return getprop("persist.sys.locale") if EON else 'en-US'
|
|
|
|
def events():
|
|
i18n = gettext.translation('events', localedir=locale_dir, fallback=True, languages=[get_locale()])
|
|
i18n.install()
|
|
return i18n.gettext |