mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
+ Added SUPPORTED_LANGUAGES, a global constant dictionary of language => display pairs for languages we support. + Add Translator.get_translator, a function used to retrieve a translator after initializing it (if needed). Use `fallback=True` while creating languages, in case we setup a language that we don't have a translation for, it will noop the translation. This is particularly useful for "en," since we do not translate it, but doing this will allow us to go through our normal translation flow in any case. + Added typing. + Added get_request_language, a function that grabs the language for a request session, defaulting to aurweb.config [options] default_lang. + Added get_raw_translator_for_request, a function that retrieves the concrete translation object for a given language. + Added tr, a jinja2 contextfilter that can be used to inline translate strings in jinja2 templates. + Added `python-jinja` dep to .gitlab-ci.yml. This needs to be included in documentation before this set is merged in. + Introduce pytest units (test_l10n.py) in `test` along with __init__.py, which marks `test` as a test package. + Additionally, fix up notify.py to use the global translator. Also reduce its source width to <= 80 by newlining some code. + Additionally, prepare locale in .gitlab-ci.yml and add aurweb.config [options] localedir to config.dev with YOUR_AUR_ROOT like others. Signed-off-by: Kevin Morris <kevr@0cost.org> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
26 lines
1 KiB
YAML
26 lines
1 KiB
YAML
image: archlinux
|
|
|
|
cache:
|
|
key: system-v1
|
|
paths:
|
|
# For some reason Gitlab CI only supports storing cache/artifacts in a path relative to the build directory
|
|
- .pkg-cache
|
|
|
|
before_script:
|
|
- pacman -Syu --noconfirm --noprogressbar --needed --cachedir .pkg-cache
|
|
base-devel git gpgme protobuf pyalpm python-mysql-connector
|
|
python-pygit2 python-srcinfo python-bleach python-markdown
|
|
python-sqlalchemy python-alembic python-pytest python-werkzeug
|
|
python-pytest-tap python-fastapi hypercorn nginx python-authlib
|
|
python-itsdangerous python-httpx python-jinja python-pytest-cov
|
|
python-requests python-aiofiles python-python-multipart
|
|
python-pytest-asyncio python-coverage
|
|
|
|
test:
|
|
script:
|
|
- python setup.py install
|
|
- sed -r "s;YOUR_AUR_ROOT;$(pwd);g" conf/config.dev > conf/config
|
|
- AUR_CONFIG=conf/config make -C po all install
|
|
- AUR_CONFIG=conf/config python -m aurweb.initdb
|
|
- make -C test
|
|
- coverage report --include='aurweb/*'
|