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>
42 lines
1.2 KiB
Text
42 lines
1.2 KiB
Text
; Configuration file for aurweb development.
|
|
;
|
|
; Options are implicitly inherited from conf/config.defaults, which lists all
|
|
; available options for productions, and their default values. This current file
|
|
; overrides only options useful for development, and introduces
|
|
; development-specific options too.
|
|
|
|
[database]
|
|
backend = sqlite
|
|
name = YOUR_AUR_ROOT/aurweb.sqlite3
|
|
|
|
; Alternative MySQL configuration
|
|
;backend = mysql
|
|
;name = aurweb
|
|
;user = aur
|
|
;password = aur
|
|
|
|
[options]
|
|
aur_location = http://127.0.0.1:8080
|
|
disable_http_login = 0
|
|
enable-maintenance = 0
|
|
localedir = YOUR_AUR_ROOT/web/locale
|
|
|
|
; Single sign-on; see doc/sso.txt.
|
|
[sso]
|
|
openid_configuration = http://127.0.0.1:8083/auth/realms/aurweb/.well-known/openid-configuration
|
|
client_id = aurweb
|
|
client_secret =
|
|
|
|
[php]
|
|
; Address PHP should bind when spawned in development mode by aurweb.spawn.
|
|
bind_address = 127.0.0.1:8081
|
|
|
|
; Directory containing aurweb's PHP code, required by aurweb.spawn.
|
|
htmldir = YOUR_AUR_ROOT/web/html
|
|
|
|
[fastapi]
|
|
; Address uvicorn should bind when spawned in development mode by aurweb.spawn.
|
|
bind_address = 127.0.0.1:8082
|
|
|
|
; Passphrase FastAPI uses to sign client-side sessions.
|
|
session_secret = secret
|