From 2d89981009c1ef9b175bc38e646d64da7bc682c4 Mon Sep 17 00:00:00 2001 From: Kara Engelhardt Date: Mon, 28 Oct 2024 15:48:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20Add=20translation=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/translations-pr.yml | 24 +++++ .github/workflows/translations.yml | 48 ++++++++++ Makefile | 2 + .../locale/de/LC_MESSAGES/django.po | 89 +++++++++++++++++++ 4 files changed, 163 insertions(+) create mode 100644 .github/workflows/translations-pr.yml create mode 100644 .github/workflows/translations.yml create mode 100644 Makefile create mode 100644 froide_evidencecollection/locale/de/LC_MESSAGES/django.po diff --git a/.github/workflows/translations-pr.yml b/.github/workflows/translations-pr.yml new file mode 100644 index 0000000..af23912 --- /dev/null +++ b/.github/workflows/translations-pr.yml @@ -0,0 +1,24 @@ +name: Open translation PR + +on: + push: + branches: + - weblate + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +permissions: + pull-requests: write + +jobs: + translation-pr: + name: "Create Translation PR" + runs-on: ubuntu-latest + steps: + - name: create pull request + run: gh pr create -B main -H weblate --title 'Translations update from Weblate' --body '' --repo $GITHUB_REPOSITORY || true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 0000000..ae5ffa2 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,48 @@ +name: Update translations + +on: + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +permissions: + contents: write + +jobs: + translations: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install system-level dependencies + run: sudo apt-get update && sudo apt-get install gettext + - name: Setup uv + uses: astral-sh/setup-uv@v2 + with: + enable-cache: true + cache-dependency-glob: | + requirements*.txt + pyproject.toml + - name: Setup venv + run: | + uv venv --python 3.12 + source .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV + - name: Install dependencies + run: | + uv pip install -e . + - name: Setup Git + run: | + git config user.name "fdsbot" + git config user.email "119665132+fdsbot@users.noreply.github.com" + - name: Compile translations + run: make messagesde + - name: Commit translations + run: | + git add **/django.po || true + git commit -m "💬 update translation messages" || true + git push -u origin main:weblate-source --force diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4b1eb44 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +messagesde: + django-admin makemessages -l de --add-location file diff --git a/froide_evidencecollection/locale/de/LC_MESSAGES/django.po b/froide_evidencecollection/locale/de/LC_MESSAGES/django.po new file mode 100644 index 0000000..bfc9044 --- /dev/null +++ b/froide_evidencecollection/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,89 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-10-28 15:45+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +#: froide_evidencecollection/cms_apps.py +msgid "Evidence Collection CMS App" +msgstr "" + +#: froide_evidencecollection/models.py +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +msgid "Source" +msgstr "" + +#: froide_evidencecollection/models.py +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +msgid "Evidence Type" +msgstr "" + +#: froide_evidencecollection/models.py +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Evidence Area" +msgstr "" + +#: froide_evidencecollection/models.py +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Person" +msgstr "" + +#: froide_evidencecollection/models.py +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Evidence Quality" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +#, python-format +msgid "Evidence #%(pk)s" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/detail.html +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Date" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Refine your query" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Search" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "No." +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Export search as CSV" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "Export search as XLSX" +msgstr "" + +#: froide_evidencecollection/templates/froide_evidencecollection/list.html +msgid "No results" +msgstr "" + +#: froide_evidencecollection/views.py +#, python-format +msgid "Evidence #%s" +msgstr ""