Wishlist: Improve KiCad i18n integration with Python plugin
Description
Just like KiCad itself, plugins should also be internationalizable. Python code can rely on their own gettext calls to make translation work, but KiCad should provide an easy way for plugins to know which language it should load to make the UI uniform wit h KiCad's (because system locale can be different from KiCad's working language, this should be taken in to account). This also reduces the effort required to make gettext find the correct mo file.
Proposal:
- Add an API like
pcbnew.GetCurrentLanguageLocale()
which returns locale strings likeen
zh_CN
. - If possible, a new mechanism that allows plugin's basic information (name, description) being reloaded (if the plugin supported i18n) upon language switch
Steps to reproduce
KiCad Version
Application: KiCad PCB 编辑器 (64-bit)
Version: (6.0.1), release build
Libraries:
wxWidgets 3.1.5
libcurl/7.78.0-DEV Schannel zlib/1.2.11
Platform: Windows 10 (build 19041), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Jan 15 2022 13:36:27
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.76.0
OCC: 7.5.0
Curl: 7.78.0-DEV
ngspice: 35
Compiler: Visual C++ 1929 without C++ ABI
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON
Edited by RigoLigoRLC