Closed jcacosta89 closed 1 year ago
@jcacosta89 please test this branch: https://github.com/threedi/hhnk-threedi-plugin/tree/fix_locale.
I've modified the code to ignore translation if QSettings().value("locale/userLocale") yields None. Think that will be a safe fix as local_path doesn't exist for any-one as there is no i18n folder in the plugin_dir. Therefore we could also consider to remove the code entirely later.
locale = QSettings().value("locale/userLocale")
if locale is not None:
locale_path = os.path.join(
self.plugin_dir, "i18n", "HHNK_threedi_toolbox_{}.qm".format(locale[0:2])
)
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
QCoreApplication.installTranslator(self.translator)
Is bij Juan -> None Is bij Wietse -> 'en_Us'
hij crasht erop dat ie QSettings().value('locale/userLocale')[0:2] wil pakken.