mirror of
https://github.com/vyos/vyos-documentation.git
synced 2025-10-26 08:41:46 +01:00
add localazy as the translation provider
This commit is contained in:
parent
84f5f73725
commit
540db56694
5
.github/workflows/main.yml
vendored
5
.github/workflows/main.yml
vendored
@ -13,11 +13,6 @@ jobs:
|
||||
id: file_changes
|
||||
uses: trilom/file-changes-action@v1.2.3
|
||||
|
||||
#- name: Vale
|
||||
# uses: errata-ai/vale-action@v1.3.0
|
||||
# with:
|
||||
# files: '${{ steps.file_changes.outputs.files_modified }}'
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
|
||||
1
.github/workflows/submodules.yml
vendored
1
.github/workflows/submodules.yml
vendored
@ -11,6 +11,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: ${{ github.repository }}
|
||||
|
||||
- name: update submodule
|
||||
run: |
|
||||
git submodule status
|
||||
|
||||
58
.github/workflows/update-translations.yml
vendored
Normal file
58
.github/workflows/update-translations.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
name: "translation: generate, upload, download"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
- name: Install Dev Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Build Documentation
|
||||
run: |
|
||||
cd docs
|
||||
make gettext
|
||||
cd ..
|
||||
|
||||
- name: upload pot files
|
||||
uses: localazy/upload@v1
|
||||
with:
|
||||
read_key: ${{ secrets.LOCALAZY_READ_KEY }}
|
||||
write_key: ${{ secrets.LOCALAZY_WRITE_KEY }}
|
||||
|
||||
- name: download translation files
|
||||
uses: localazy/download@v1
|
||||
with:
|
||||
read_key: ${{ secrets.LOCALAZY_READ_KEY }}
|
||||
write_key: ${{ secrets.LOCALAZY_WRITE_KEY }}
|
||||
|
||||
- name: set file ownership
|
||||
run: |
|
||||
sudo chown -R 1001 docs/_locale
|
||||
ls -l docs/_locale/de
|
||||
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v3
|
||||
with:
|
||||
token: ${{secrets.GITHUB_TOKEN}}
|
||||
add-paths: docs/_locale/*
|
||||
commit-message: "Github: update translations"
|
||||
committer: GitHub <noreply@github.com>
|
||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||
title: "Github: update translations"
|
||||
body: |
|
||||
Generate, upload new and download translation files
|
||||
branch: update-translations-master
|
||||
delete-branch: true
|
||||
1017
.tx/config
1017
.tx/config
File diff suppressed because it is too large
Load Diff
32
localazy.json
Normal file
32
localazy.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"upload": {
|
||||
"type": "pot",
|
||||
"folder": "docs/_build/gettext",
|
||||
"files": {
|
||||
"pattern": "**.pot",
|
||||
"excludes": [
|
||||
"changelog/*.pot",
|
||||
"coverage.pot"
|
||||
],
|
||||
"path": "${path}"
|
||||
}
|
||||
},
|
||||
|
||||
"transformations": [
|
||||
{
|
||||
"name": "trans_path",
|
||||
"source": "${path}",
|
||||
"operations": "remove: docs/_build/gettext"
|
||||
}
|
||||
],
|
||||
|
||||
"download": {
|
||||
"files": "docs/_locale/${lang}/${trans_path}/${fileWithoutExt}.pot"
|
||||
},
|
||||
"conversion": {
|
||||
"actions": {
|
||||
"type": "mo",
|
||||
"output": "docs/_locale/${lang}/LC_MESSAGES/${trans_path}/${fileWithoutExt}.mo"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user