samzong / weblate-batch-scripts

batch create components from gitlab repo to weblate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weblate-batch-scripts

新增依赖安装

# poetry
poetry add wlc python-gitlab gitpython jinja2

# pip
pip3 install wlc python-gitlab gitpython jinja2

生成配置文件 config.py

请替换自己的 Key

WEBLATE_API_URL = ""
WEBLATE_API_TOKEN = ""
GITLAB_URL = ""
GITLAB_PERSON_TOKEN = ''
GITLAB_CLONE_URL = "https://oauth2:xxxxxxxxxx@gitlab."

run in k8s

提供了模板配置文件 run_in_k8s.yaml,直接 apply yaml 文件,即可完成应用的部署.

kubectl -n your_namespace apply -f run_in_k8s.yaml

增加新的 project ,本次最大的更新部分,只需要更新 configmap 即可完成项目更新

  1. 修改 ConfigMap weblate-projects,完成配置文件更新 kubectl edit cm weblate-projects
  2. 重启 weblate-batch-scripts pod,完成项目更新 kubectl rollout restart deployment weblate-batch-scripts

使用 docker 的方式运行

使用 Dockerfile 自行编译

v0.2

  • 支持根据一个前端仓库地址,自动化创建项目并同步所有组件
  • 支持点击更新项目待翻译内容
    • 接口获取项目列表
    • 选择项目,通过 gitapi 来创建分支,同步最新的翻译进度
    • 同步全部部件的更新
  • 页面展示对应的徽章

v0.1

  • batch create new components from another one.
  • batch create new components from a template.

Configure

  1. clone translate project to local
  2. find files in repo . like project_name/src/locales/zh-CN/
  3. run cp config.py.example config.py and modify ProjectConfig class
  4. find u API_TOKEN at /account/profile

Running

- pip install -r requirements.txt
- make serve

Web

Feature

  • 支持网页输入代码仓库
  • 支持自动上传

About

batch create components from gitlab repo to weblate


Languages

Language:HTML 61.2%Language:Python 35.6%Language:Makefile 2.0%Language:Dockerfile 1.2%