Skip to content

Commit

Permalink
Merge branch 'main' into feature/geotribu-toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
gounux authored Mar 18, 2024
2 parents 0e0e3cf + cefbfd7 commit d3d2494
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ name: "✅ Linter"

on:
push:
branches: [main]
branches:
- main
paths:
- "**.py"

pull_request:
branches: [main]
branches:
- main
paths:
- "**.py"

Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ env:

on:
push:
branches: [main]
branches:
- main
tags:
- "*"

pull_request:
branches: [main]
branches:
- main
paths:
- .github/workflows/packager.yml

Expand All @@ -24,13 +26,20 @@ jobs:
- name: Get source code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"

- name: Install system requirements
run: |
sudo apt update
sudo apt install qt5-qmake qttools5-dev-tools
python3 -m pip install -U pyqt5-tools
- name: Update translations
run: lupdate -noobsolete -verbose ${{ env.PROJECT_FOLDER }}/resources/i18n/plugin_translation.pro
run: pylupdate5 -noobsolete -verbose ${{ env.PROJECT_FOLDER }}/resources/i18n/plugin_translation.pro

- name: Compile translations
run: lrelease ${{ env.PROJECT_FOLDER }}/resources/i18n/*.ts
Expand Down
15 changes: 14 additions & 1 deletion qtribu/plugin_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,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 d3d2494

Please sign in to comment.