Compare commits

..

1 Commits

Author SHA1 Message Date
Jonas Schäfer
b84b84b394 Add check for a missing make extract_translations
Forgetting to run that causes weblate (or other translation tools) to
show outdated strings and not import new strings, which is bad for the
collaboration.

Fixes #118.
2022-01-22 14:57:59 +01:00
5 changed files with 27 additions and 3 deletions

View File

@@ -50,6 +50,29 @@ jobs:
run: |
python -m flake8 snikket_web
translation-check:
runs-on: ubuntu-latest
name: 'lint: i18n'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Install
run: |
set -euo pipefail
pip install flask-babel
- name: Linting
run: |
sed -ri '/^"POT-Creation-Date: /d' snikket_web/translations/messages.pot
git add snikket_web/translations/messages.pot
make extract_translations
sed -ri '/^"POT-Creation-Date: /d' snikket_web/translations/messages.pot
git diff --exit-code --color -- snikket_web/translations/messages.pot
build:
runs-on: ubuntu-latest

View File

@@ -5,5 +5,5 @@ hsluv~=0.0.2
flask-babel~=1.0
email-validator~=1.1
environ-config~=20.0
wtforms~=3.0
wtforms~=2.3
typing-extensions

View File

@@ -10,6 +10,7 @@ import aiohttp
import quart.flask_patch
import wtforms
import wtforms.fields.html5
from quart import (
Blueprint,

View File

@@ -32,7 +32,7 @@ bp = quart.Blueprint("main", __name__)
class LoginForm(BaseForm):
address = wtforms.StringField(
address = wtforms.TextField(
_l("Address"),
validators=[wtforms.validators.InputRequired()],
)

View File

@@ -59,7 +59,7 @@ _ACCESS_MODEL_CHOICES = [
class ProfileForm(BaseForm):
nickname = wtforms.StringField(
nickname = wtforms.TextField(
_l("Display name"),
)