Github Action自动流翻译README文档【CI/CD】

翻译自述文件操作

一、自述文件翻译

GitHub Action 将自述文件翻译成任何语言

这是一个 GitHub Action,可以自动将你的 repo 中的自述文件翻译成指定的语言。

二、设置

  1. 添加工作流文件 到您的项目(例如.github/workflows/readme.yml):
yaml 复制代码
name: Translate README

on:
  push:
    branches:
      - main
      - master
    paths: # 只监听 README.md 文件的变化
      - 'README.md'
  pull_request:
    branches:
      - main
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Setup Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 12.x

      - name: Translate README to English
        uses: dephraiim/translate-readme@main
        with:
          LANG: en
	 - name: Adding README - Chinese Simplified
       uses: dephraiim/translate-readme@main
       with:
         LANG: zh-CN

      - name: Commit and push changes
        run: |
          git config --local user.email "action@github.com"
          git config --local user.name "GitHub Action"
          git add README.en.md
          git commit -m ":memo: Automated translation"
          git push origin HEAD:${{ github.ref }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  1. 选项
  • 您可以使用以下选项进一步配置操作:

  • LANG:您要将自述文件翻译成的语言。默认为简体中文。 (我是加纳人)可在下方找到支持的语言。

    (默认:zh-CH) (必需的:false)

3.** 支持的语言**

三、效果

四、发展

通过使用翻译 Action,我们可以轻松地将项目中的文档、代码注释等翻译成多种语言,从而方便不同语言背景的开发人员协作开发。这对于国际化的项目来说尤为重要。

感谢您阅读本文!希望本文对您有所帮助。如果您有任何疑问或建议,请随时与我联系。
您的关注是我最大的支持🌹🌹

相关推荐
研究点啥好呢3 小时前
Github热门项目推荐 | 创建你的像素风格!
c++·python·node.js·github·开源软件
无限进步_4 小时前
【C++】电话号码的字母组合:从有限处理到通用解法
开发语言·c++·ide·windows·git·github·visual studio
MicrosoftReactor4 小时前
技术速递|使用 Copilot SDK 构建 AI 驱动的 GitHub Issue 分类系统
人工智能·github·copilot
AI成长日志4 小时前
【GitHub开源项目专栏】AI推理优化框架深度解析(上):vLLM架构设计与核心实现
人工智能·开源·github
CV-deeplearning5 小时前
【开源】字节跳动开源 DeerFlow 2.0:一站式 SuperAgent 开发框架,GitHub 星标 5.9 万!
开源·github·deerflow·deerflow 2.0·superagent
Freak嵌入式6 小时前
MicroPython LVGL基础知识和概念:显示与多屏管理
开发语言·python·github·php·gui·lvgl·micropython
REDcker6 小时前
Jenkins 开源 CI/CD 平台概览与版本演进
ci/cd·开源·jenkins
zandy10116 小时前
【全新 3.0版本】openclaw github installation guide
github·openclaw·installation
Freak嵌入式7 小时前
MicroPython LVGL基础知识和概念:时序与动态效果
开发语言·python·github·php·gui·lvgl·micropython
北冥有羽Victoria8 小时前
OpenCLI 操作网页 从0到1完整实操指南
vscode·爬虫·python·github·api·ai编程·opencli