Skip to content

Commit

Permalink
improve project tx script
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jan 29, 2024
1 parent 8eaf7f5 commit 570b558
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/project-translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Translate
run: |
docker compose run qgis sh -c 'xvfb-run /usr/src/scripts/project-translation-create-source.py'
docker compose run qgis sh -c 'xvfb-run /usr/src/scripts/project-translation-create-source.py /usr/src/project/signalo.qgs'
- name: Push to TX
run: ./tx push --source
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ project/signalo_attachments.zip
website/tx
website/local.html

data/*

.idea
.DS_Store
*.orig
Expand Down
12 changes: 10 additions & 2 deletions scripts/project-translation-create-source.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/usr/bin/python3

import argparse

from qgis.core import QgsApplication, QgsProject

parser = argparse.ArgumentParser(description="Create QGIS project translation")
parser.add_argument("project")
parser.add_argument("-l", "--language", default="en")
args = parser.parse_args()

app = QgsApplication([], True)
app.setPrefixPath("/usr", True)
app.initQgis()
Expand All @@ -15,5 +22,6 @@ def print_message(message, tag, level):

project = QgsProject.instance()

project.read("/usr/src/project/signalo.qgs")
project.generateTsFile("en")
assert project.read(args.project)
print(project.mapLayers())
project.generateTsFile(args.language)

0 comments on commit 570b558

Please sign in to comment.