website: update translation docs (#5875)

* website/docs: remove lingui references

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* replace deprecated cryptography types

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* tell eslint to avoid escapes in strings when possible

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* ignore generated locale code

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-06-06 12:32:32 +02:00
committed by GitHub
parent d9eaefa68a
commit 69f0460f69
12 changed files with 48 additions and 79 deletions

View File

@ -4,7 +4,7 @@ title: Translations
Translation in authentik is done in two places. Most of the text is defined in the frontend in `web/`, and a subset of messages is defined in the backend.
The frontend uses [lingui](https://lingui.js.org/), and the backend uses the built-in django translation tools.
The frontend uses [@lit/localize](https://lit.dev/docs/localization/overview/), and the backend uses the built-in django translation tools.
:::info
Please review the [Writing documentation](./docs/writing-documentation) guidelines as they apply to documentation too.
@ -24,22 +24,21 @@ To simplify translation you can use https://www.transifex.com/authentik/authenti
Run `npm i` in the `/web` folder to install all dependencies.
Ensure the language code is in the `package.json` file in `web/`:
Ensure the language code is in the `lit-localize.json` file in `web/`:
```json
// [...]
"lingui": {
"targetLocales": [
"en",
"pseudo-LOCALE",
"a-new-locale"
// [...]
"locales": [
"en",
"pseudo-LOCALE",
"a-new-locale"
],
],
// [...]
```
Afterwards, run `npx lingui extract` to generate a base .po file.
Afterwards, run `make web-i18n-extract` to generate a base .xlf file.
The .po files can be edited by any text editor, or using a tool such as [POEdit](https://poedit.net/).
The .xlf files can be edited by any text editor, or using a tool such as [POEdit](https://poedit.net/).
To see the change, run `npm run watch` in the `web/` directory.
To see the change, run `make web-watch` in the root directory of the repository.