🏗️(common) remove localization support (crowdin)

Not required for SATOSA, at least for now.
This commit is contained in:
Jonathan Perret
2024-04-15 18:25:47 +02:00
parent 5492cfaf8b
commit acc3df5b03
7 changed files with 1 additions and 248 deletions
-49
View File
@@ -127,54 +127,5 @@ jobs:
# Python's xmlsec requirement
sudo apt-get update -y -q && sudo apt-get install -y -q libxmlsec1-dev
pip install --user .[dev]
- name: Install gettext (required to compile messages)
run: |
sudo apt-get update
sudo apt-get install -y gettext
- name: Generate a MO file from strings extracted from the project
run: python manage.py compilemessages
- name: Run tests
run: ~/.local/bin/pytest -n 2
i18n-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install gettext (required to make messages)
run: |
sudo apt-get update
sudo apt-get install -y gettext
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install development dependencies
working-directory: src/backend
run: |
# Python's xmlsec requirement
sudo apt-get update -y -q && sudo apt-get install -y -q libxmlsec1-dev
pip install --user .[dev]
- name: Generate the translation base file
run: ~/.local/bin/django-admin makemessages --keep-pot --all
- name: Load sops secrets
uses: rouja/actions-sops@main
with:
secret-file: .github/workflows/secrets.enc.env
age-key: ${{ secrets.SOPS_PRIVATE }}
- name: Upload files to Crowdin
run: |
docker run \
--rm \
-e CROWDIN_API_TOKEN=$CROWDIN_API_TOKEN \
-e CROWDIN_PROJECT_ID=$CROWDIN_PROJECT_ID \
-e CROWDIN_BASE_PATH=$CROWDIN_BASE_PATH \
-v "${{ github.workspace }}:/app" \
crowdin/cli:3.16.0 \
crowdin upload sources -c /app/crowdin/config.yml
+1 -51
View File
@@ -43,7 +43,6 @@ COMPOSE_EXEC = $(COMPOSE) exec
COMPOSE_EXEC_APP = $(COMPOSE_EXEC) app-dev
COMPOSE_RUN = $(COMPOSE) run --rm
COMPOSE_RUN_APP = $(COMPOSE_RUN) app-dev
COMPOSE_RUN_CROWDIN = $(COMPOSE_RUN) crowdin crowdin
WAIT_DB = @$(COMPOSE_RUN) dockerize -wait tcp://$(DB_HOST):$(DB_PORT) -timeout 60s
WAIT_KC_DB = $(COMPOSE_RUN) dockerize -wait tcp://kc_postgresql:5432 -timeout 60s
@@ -66,7 +65,6 @@ data/static:
create-env-files: ## Copy the dist env files to env files
create-env-files: \
env.d/development/common \
env.d/development/crowdin \
env.d/development/postgresql \
env.d/development/kc_postgresql
.PHONY: create-env-files
@@ -78,8 +76,7 @@ bootstrap: \
create-env-files \
build \
run \
migrate \
back-i18n-compile
migrate
.PHONY: bootstrap
# -- Docker/compose
@@ -170,14 +167,6 @@ superuser: ## Create an admin superuser with password "admin"
@$(MANAGE) createsuperuser --email [email protected] --password admin
.PHONY: superuser
back-i18n-compile: ## compile the gettext files
@$(MANAGE) compilemessages --ignore="venv/**/*"
.PHONY: back-i18n-compile
back-i18n-generate: ## create the .pot files used for i18n
@$(MANAGE) makemessages -a --keep-pot
.PHONY: back-i18n-generate
shell: ## connect to database shell
@$(MANAGE) shell #_plus
.PHONY: dbshell
@@ -203,45 +192,6 @@ env.d/development/postgresql:
env.d/development/kc_postgresql:
cp -n env.d/development/kc_postgresql.dist env.d/development/kc_postgresql
# -- Internationalization
env.d/development/crowdin:
cp -n env.d/development/crowdin.dist env.d/development/crowdin
crowdin-download: ## Download translated message from Crowdin
@$(COMPOSE_RUN_CROWDIN) download -c crowdin/config.yml
.PHONY: crowdin-download
crowdin-download-sources: ## Download sources from Crowdin
@$(COMPOSE_RUN_CROWDIN) download sources -c crowdin/config.yml
.PHONY: crowdin-download-sources
crowdin-upload: ## Upload source translations to Crowdin
@$(COMPOSE_RUN_CROWDIN) upload sources -c crowdin/config.yml
.PHONY: crowdin-upload
i18n-compile: ## compile all translations
i18n-compile: \
back-i18n-compile
.PHONY: i18n-compile
i18n-generate: ## create the .pot files and extract frontend messages
i18n-generate: \
back-i18n-generate
.PHONY: i18n-generate
i18n-download-and-compile: ## download all translated messages and compile them to be used by all applications
i18n-download-and-compile: \
crowdin-download \
i18n-compile
.PHONY: i18n-download-and-compile
i18n-generate-and-upload: ## generate source translations for all applications and upload them to Crowdin
i18n-generate-and-upload: \
i18n-generate \
crowdin-upload
.PHONY: i18n-generate-and-upload
# -- Misc
clean: ## restore repository state as it was freshly cloned
git clean -idx
-24
View File
@@ -1,24 +0,0 @@
#
# Your crowdin's credentials
#
api_token_env: CROWDIN_API_TOKEN
project_id_env: CROWDIN_PROJECT_ID
base_path_env: CROWDIN_BASE_PATH
#
# Choose file structure in crowdin
# e.g. true or false
#
preserve_hierarchy: true
#
# Files configuration
#
files:
[
{
source: "/backend/locale/django.pot",
dest: "/backend.pot",
translation: "/backend/locale/%locale_with_underscore%/LC_MESSAGES/django.po",
}
]
-9
View File
@@ -62,15 +62,6 @@ services:
dockerize:
image: jwilder/dockerize
crowdin:
image: crowdin/cli:3.16.0
volumes:
- ".:/app"
env_file:
- env.d/development/crowdin
user: "${DOCKER_USER:-1000}"
working_dir: /app
kc_postgresql:
image: postgres:14.3
platform: linux/amd64
-3
View File
@@ -1,3 +0,0 @@
CROWDIN_API_TOKEN=Your-Api-Token
CROWDIN_PROJECT_ID=Your-Project-Id
CROWDIN_BASE_PATH=/app/src
Binary file not shown.
@@ -1,112 +0,0 @@
msgid ""
msgstr ""
"Project-Id-Version: lasuite-oidc2fer\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-09 23:01+0000\n"
"PO-Revision-Date: 2024-03-08 13:15\n"
"Last-Translator: \n"
"Language-Team: French\n"
"Language: fr_FR\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"
"X-Crowdin-Project: lasuite-oidc2fer\n"
"X-Crowdin-Project-ID: 637934\n"
"X-Crowdin-Language: fr\n"
"X-Crowdin-File: backend.pot\n"
"X-Crowdin-File-ID: 2\n"
#: core/admin.py:23
msgid "Personal info"
msgstr ""
#: core/admin.py:25
msgid "Permissions"
msgstr ""
#: core/admin.py:37
msgid "Important dates"
msgstr ""
#: core/models.py:25
msgid "id"
msgstr ""
#: core/models.py:26
msgid "primary key for the record as UUID"
msgstr ""
#: core/models.py:32
msgid "created on"
msgstr ""
#: core/models.py:33
msgid "date and time at which a record was created"
msgstr ""
#: core/models.py:38
msgid "updated on"
msgstr ""
#: core/models.py:39
msgid "date and time at which a record was last updated"
msgstr ""
#: core/models.py:56
msgid "email address"
msgstr ""
#: core/models.py:61
msgid "language"
msgstr ""
#: core/models.py:62
msgid "The language in which the user wants to see the interface."
msgstr ""
#: core/models.py:68
msgid "The timezone in which the user wants to see times."
msgstr ""
#: core/models.py:71
msgid "device"
msgstr ""
#: core/models.py:73
msgid "Whether the user is a device or a real user."
msgstr ""
#: core/models.py:76
msgid "staff status"
msgstr ""
#: core/models.py:78
msgid "Whether the user can log into this admin site."
msgstr ""
#: core/models.py:81
msgid "active"
msgstr ""
#: core/models.py:84
msgid ""
"Whether this user should be treated as active. Unselect this instead of "
"deleting accounts."
msgstr ""
#: core/models.py:96
msgid "user"
msgstr ""
#: core/models.py:97
msgid "users"
msgstr ""
#: oidc2fer/settings.py:122
msgid "English"
msgstr ""
#: oidc2fer/settings.py:123
msgid "French"
msgstr ""