Skip to content

Commit

Permalink
🌐 Add translation workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Oct 28, 2024
1 parent 13f8606 commit 2d89981
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/translations-pr.yml
Original file line number Diff line number Diff line change
@@ -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 }}
48 changes: 48 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
- 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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
messagesde:
django-admin makemessages -l de --add-location file
89 changes: 89 additions & 0 deletions froide_evidencecollection/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\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 ""

0 comments on commit 2d89981

Please sign in to comment.