Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 739e97b4 authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

feat(i18n): add auto translation about fr and de

parent 07eb2406
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+33 −0
Original line number Diff line number Diff line
.default-docker:
  image: docker:29.1
  services:
    - docker:29.1-dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
    DOCKER_TLS_CERTDIR: ""
    DOCKER_BUILDKIT: "1"
  tags:
    - generic_privileged

.docker:
  stage: build
  extends: .default-docker
  before_script:
    - echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
    - docker buildx create --use
    - docker buildx inspect --bootstrap

docker-build:
  extends: .docker
  script:
    - docker buildx build --provenance=false --sbom=false --build-arg CHATGPT_TOKEN=${CHATGPT_TOKEN} -t $CI_REGISTRY_IMAGE:latest --load .
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'

docker-latest:
  extends: .docker
  script:
    - docker buildx build --provenance=false --sbom=false --build-arg CHATGPT_TOKEN=${CHATGPT_TOKEN} -t $CI_REGISTRY_IMAGE:latest --push .
  rules:
    - if: '$CI_COMMIT_REF_NAME == "main" && $CI_PIPELINE_SOURCE != "schedule"'
+12 −4
Original line number Diff line number Diff line
FROM python:3.12.7-slim AS builder
FROM python:3.14-slim AS builder

ARG CHATGPT_TOKEN

ENV GIT_PYTHON_REFRESH=quiet
RUN apt-get update && apt-get install -y git
RUN pip install mkdocs-material mkdocs-git-revision-date-localized-plugin
ENV CHATGPT_TOKEN=${CHATGPT_TOKEN}

WORKDIR /ws

COPY . /ws/

RUN apt-get update && apt-get install -y git
RUN pip install -r requirements.txt
RUN python scripts/translate_docs.py

RUN sed -i '/enabled: false/d' mkdocs.yml && mkdocs build --site-dir /tmp/public

FROM nginx:1.27.2
FROM nginx:1.29.4-alpine

COPY --from=builder /tmp/public /usr/share/nginx/html
+8 −3
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ The current documentation uses [Material for mkdocs](https://squidfunk.github.io

Install dependencies:
```
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin
pip install -r requirements.txt
```

Run the doc server locally:
@@ -23,10 +23,15 @@ For more details, see the official guide [getting started](https://squidfunk.git

### Device pages

```python
pip install -r scripts/requirements.txt
```bash
python ./scripts/generate_device_pages.py htdocs/_data/devices devices
python ./scripts/generate_device_pages.py htdocs/_data/devices device-list
```

### Generate translation

```bash
CHATGPT_TOKEN=<token> python ./scripts/translate_docs.py
```

+13 −0
Original line number Diff line number Diff line
@@ -359,6 +359,19 @@ plugins:
- tags
- privacy:
    assets: false
- i18n:
    docs_structure: folder
    languages:
      - locale: en
        default: true
        name: English
        build: true
      - locale: fr
        name: Français
        build: true
      - locale: de
        name: Deutsch
        build: true
- git-revision-date-localized:
    enable_creation_date: true
    enabled: false
Loading