mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-21 00:28:08 +08:00
Add localazy.json and related automations
This commit is contained in:
parent
f0436654c0
commit
e6073ec8ef
56
.github/workflows/translations-download.yaml
vendored
Normal file
56
.github/workflows/translations-download.yaml
vendored
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
name: Download translation files from Localazy
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
secrets:
|
||||||
|
ELEMENT_BOT_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
download:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout the code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: "yarn"
|
||||||
|
|
||||||
|
- name: Install Deps
|
||||||
|
run: "yarn install --frozen-lockfile"
|
||||||
|
|
||||||
|
- name: Prune i18n
|
||||||
|
run: "rm -R public/locales"
|
||||||
|
|
||||||
|
- name: Download translation files
|
||||||
|
uses: localazy/download@v1.1.0
|
||||||
|
with:
|
||||||
|
groups: "-p includeSourceLang:true"
|
||||||
|
|
||||||
|
- name: Fix the owner of the downloaded files
|
||||||
|
run: "sudo chown runner:docker -R public/locales"
|
||||||
|
|
||||||
|
- name: Prettier
|
||||||
|
run: yarn prettier:format
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
id: cpr
|
||||||
|
uses: peter-evans/create-pull-request@v5.0.2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
branch: actions/localazy-download
|
||||||
|
delete-branch: true
|
||||||
|
title: Localazy Download
|
||||||
|
commit-message: Translations updates
|
||||||
|
labels: |
|
||||||
|
T-Task
|
||||||
|
|
||||||
|
- name: Enable automerge
|
||||||
|
run: gh pr merge --merge --auto "$PR_NUMBER"
|
||||||
|
if: steps.cpr.outputs.pull-request-operation == 'created'
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
|
PR_NUMBER: ${{ steps.cpr.outputs.pull-request-number }}
|
20
.github/workflows/translations-upload.yaml
vendored
Normal file
20
.github/workflows/translations-upload.yaml
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
name: Upload translation files to Localazy
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- livekit
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
upload:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout the code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Upload
|
||||||
|
uses: localazy/upload@v1
|
||||||
|
with:
|
||||||
|
write_key: ${{ secrets.LOCALAZY_WRITE_KEY }}
|
33
localazy.json
Normal file
33
localazy.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"readKey": "a7580769542256117579-70975387172511848f4c6533943d776547bad4853931ba352ee684b738f4494e",
|
||||||
|
|
||||||
|
"upload": {
|
||||||
|
"type": "json",
|
||||||
|
"deprecate": "file",
|
||||||
|
"features": ["plural_postfix_us", "filter_untranslated"],
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"pattern": "public/locales/en-GB/*.json",
|
||||||
|
"lang": "inherited"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group": "existing",
|
||||||
|
"pattern": "public/locales/*/*.json",
|
||||||
|
"excludes": ["public/locales/en-GB/*.json"],
|
||||||
|
"lang": "${autodetectLang}"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"download": {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"output": "public/locales/${langLsrDash}/${file}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"includeSourceLang": "${includeSourceLang|false}",
|
||||||
|
"langAliases": {
|
||||||
|
"en": "en_GB"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user