Skip to content

Commit

Permalink
i18n: log about QM file
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Mar 13, 2024
1 parent 7cd23fc commit c7ef57a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion qtribu/plugin_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,24 @@ def __init__(self, iface: QgisInterface):
locale_path: Path = (
DIR_PLUGIN_ROOT / f"resources/i18n/{__title__.lower()}_{self.locale}.qm"
)
self.log(message=f"Translation: {self.locale}, {locale_path}", log_level=4)
self.log(
message=f"Translation: {self.locale}, {locale_path} "
f"(exists={locale_path.exists()})",
log_level=4,
)
if locale_path.exists():
self.translator = QTranslator()
self.translator.load(str(locale_path.resolve()))
QCoreApplication.installTranslator(self.translator)
self.log(
message=f"Translation loaded from file: {self.locale}, {locale_path}",
log_level=4,
)
else:
self.log(
message=f"Translation file does not exist: {self.locale}, {locale_path}",
log_level=1,
)

# sub-modules
self.rss_rdr = RssMiniReader()
Expand Down

0 comments on commit c7ef57a

Please sign in to comment.