From 8d805929d94a77b6badae57de2b79d8e27347c3a Mon Sep 17 00:00:00 2001 From: Continuous Integration Date: Mon, 13 Jan 2025 02:58:26 +0000 Subject: [PATCH] Auto-translate README --- README.French.md | 91 ++++++++++++++++++++++++------------------------ README.md | 72 +++++++++++++++++++------------------- README.zh-CN.md | 22 ++++++------ 3 files changed, 91 insertions(+), 94 deletions(-) diff --git a/README.French.md b/README.French.md index 17dd007..fc86bc5 100644 --- a/README.French.md +++ b/README.French.md @@ -10,41 +10,40 @@ * [Française](README.French.md) # Introduction - -> [!NOTE] -> La version `v1` du traducteur est réalisée via des paquets tiers sous `Linux` ; la version `v2` est réalisée via une IA générative pour la traduction. +> [!NOTE] +> Le traducteur de la version `v1` est réalisé via un paquet tiers de `Linux` ; la version `v2` est réalisée via une traduction AI générative. -* Nous savons tous que rédiger un README prend du temps, mais il existe maintenant une solution qui peut vous faire gagner la moitié de ce temps. C'est notre `action-translate-readme` +* Nous savons tous que rédiger des documents README prend beaucoup de temps, mais il existe maintenant une solution qui peut vous faire gagner la moitié du temps. C'est notre `action-translate-readme`. -* Traduire les README dans différentes langues via une **IA générative** +* Traduire différentes versions linguistiques du README grâce à l'**AI générative** -* Soumettre automatiquement (commit, push) les fichiers traduits via **Github Actions (CI/CD)** +* **Soumission automatique (commit, push) via Github Actions (CI/CD)** des fichiers traduits -* Par exemple : **écrire** ou **modifier** le README en anglais, générer automatiquement les versions en chinois traditionnel, chinois simplifié, français, etc. +* Par exemple : **rédiger** ou **modifier** un README en anglais, générer automatiquement les versions chinoises traditionnelle et simplifiée, française... etc. du README. -# How to use ? +# Comment l'utiliser ? > [!IMPORTANT] -> Étant donné que les résultats de la traduction par le modèle d'IA générative peuvent présenter des problèmes à chaque tentative, il est recommandé d'exécuter sur une branche et de fusionner ensuite avec la branche principale. +> Comme le modèle AI génératif a une chance de générer des erreurs à chaque traduction, il est recommandé d'exécuter sur un branche et de fusionner à la fin. > [!WARNING] -> Si vous rencontrez l'erreur suivante : `Error: Input required and not supplied: token`, veuillez suivre les étapes ci-dessous pour vous assurer que le `Token` a été créé, ou vérifiez si le `Token` a expiré ! +> Si vous rencontrez l'erreur suivante : `Error: Input required and not supplied: token`, assurez-vous de créer ou vérifier si le `Token` est périmé, selon l'étape deux ci-dessous ! 1. Cliquez sur l'icône :star: pour ajouter ce projet à votre dépôt Github. -2. Configurez votre `Github Token` (**obligatoire**) : - - 1. [Créer un nouveau **`Github Secret Token`**](https://github.com/settings/tokens/new) - * Configuration - * Paramètres du développeur - * Jetons d'accès personnels - `Tokens(classic)` - * Générer un nouveau jeton - * Choisir la **durée de vie** du jeton - Il est recommandé d'utiliser **illimité** - * Choisir les scopes : `repo` et `workflow` - * **Conserver** votre secret token (ne le perdez pas, vous en aurez besoin plus tard) - +2. Configurez votre `Github Token` (**obligatoire**): + + 1. [Créez un nouveau **`Github Secret Token`**](https://github.com/settings/tokens/new) + * Réglages + * Réglages développeur + * Tokens d'accès personnel - `Tokens(classic)` + * Générer un nouveau token + * Choisir la **durée de vie** du token - Recommandé : **illimité** + * Choisir les étendues : `repo` et `workflow` + * **Gardez** votre token secret (ne le perdez pas, vous en aurez besoin plus tard) + 2. Ajoutez le Github Token aux **`repository secret`** @@ -52,26 +51,26 @@ * `Securits and variables` * `Actions` * `New repository secret` - * Remplissez le label avec `token` et donnez-lui un nom (ex : `Action_Bot`) + * Remplissez le label et le nom par `token` (ex : `Action_Bot`) 3. Choix du modèle de traduction GPT (**optionnel**) - - * `g4f` : **Par défaut**, utilise **gratuitement** `g4f` pour les appels OpenAI et réaliser les tâches de traduction. - * `zhipuai` : Si vous avez besoin d'une traduction **gratuite et stable**, vous pouvez vous inscrire sur la [plateforme Zhipuai AI](https://open.bigmodel.cn/dev/howuse/introduction) et [demander un API KEY](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys). C'est une solution GPT entièrement gratuite, sans besoin de carte de crédit. - * Pour utiliser cette solution, veuillez ajouter l'API KEY de Zhipuai AI aux Secrets de GitHub Repos de la même manière que décrit dans **étape 2-2**. + + * `g4f` : Par défaut, utilise le `g4f` **gratuit** pour appeler OpenAI et réaliser les traductions. + * `zhipuai`: Si vous avez besoin de traductions **gratuites et stables**, vous pouvez vous inscrire sur [la plateforme Zhipuai AI](https://open.bigmodel.cn/dev/howuse/introduction) et [demander une API KEY](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys), c'est une solution de modèle GPT entièrement gratuite et sans carte de crédit. + * Pour utiliser cette solution, suivez les mêmes étapes que **étape 2-2** pour ajouter le Github Token, et ajoutez l'**API KEY de Zhipuai AI aux Secrets GitHub Repos**. - * `openai` : **Garantit une qualité élevée et stable**, si vous avez un OPENAI API KEY, le modèle `gpt-4o` sera utilisé pour la traduction. - * Pour utiliser cette solution, veuillez ajouter l'API KEY d'OpenAI aux Secrets de GitHub Repos de la même manière que décrit dans **étape 2-2**. + * `openai` : **Garantie d'une qualité élevée et stable**, si vous avez une API KEY OPENAI, le `gpt-4o` sera utilisé comme modèle de traduction. + * Pour utiliser cette solution, suivez les mêmes étapes que **étape 2-2** pour ajouter le Github Token, et ajoutez l'**API KEY OpenAI aux Secrets GitHub Repos**. -4. Créez votre exemple d'action dans le répertoire `.github/workflows/your_action.yml`. Vous pouvez directement copier ce qui suit : +4. Créez votre exemple de workflow dans le répertoire `.github/workflows/your_action.yml`. Vous pouvez directement copier ce qui suit : ```yaml # .github/workflows/translate.yml @@ -91,34 +90,34 @@ fetch-depth: 3 - name: Auto Translate - uses: Lin-jun-xiang/action-translate-readme@v2 # Basé sur le tag + uses: Lin-jun-xiang/action-translate-readme@v2 # Based on the tag with: - token: ${{ secrets.Action_Bot }} # Basé sur le nom de l'étape 2 - zhipuai: ${{ secrets.zhipuai_api_key }} # Optionnel : Basé sur l'étape 3 - openai: ${{ secrets.openai_api_key }} # Optionnel : Basé sur l'étape 3 - langs: "en,zh-TW,zh-CN,French,Arabic" # Vous pouvez définir n'importe quelles langues + token: ${{ secrets.Action_Bot }} # Based on step2 name + zhipuai: ${{ secrets.zhipuai_api_key }} # Optional: Based on step3 + openai: ${{ secrets.openai_api_key }} # Optional: Based on step3 + langs: "en,zh-TW,zh-CN,French,Arabic" # You can define any langs ``` - Dans le `.yml`, quelques paramètres nécessitent une attention particulière : + Il y a plusieurs paramètres à noter dans le `.yml`: - * `token` : Le GitHub Token utilisé pour autoriser l'action (ajouté selon l'étape 2). - * `zhipuai` : API Zhipuai, ajoutée selon l'étape 3 (optionnel) - * `openai` : API OpenAI, ajoutée selon l'étape 3 (optionnel) - * `langs` : Langues à traduire, veillez à les séparer par des `,`, par exemple : - * `"en"` : Traduire uniquement la version anglaise - * `"en,zh-TW"` : Traduire l'anglais et le chinois traditionnel - * `"French,Arabic"` : Traduire le français et l'arabe + * `token`: Le GitHub Token utilisé pour autoriser l'action (à ajouter selon l'étape deux). + * `zhipuai`: Zhipuai API, à ajouter selon l'étape trois (optionnel) + * `openai`: OpenAI API, à ajouter selon l'étape trois (optionnel) + * `langs`: Les langues à traduire, à séparer par des virgules comme suit : + * `"en"` : Traduire uniquement en anglais + * `"en,zh-TW"` : Traduire en anglais, chinois traditionnel + * `"French,Arabic"` : Traduire en français, arabe - > PS : Si ni `zhipuai`, ni `openai` n'ont été ajoutés aux Secrets de GitHub, `g4f` sera utilisé pour la traduction. + > PS: Si ni `zhipuai`, ni `openai` ne sont ajoutés aux secrets GitHub, `g4f` sera utilisé pour les traductions. -5. Maintenant, vous pouvez mettre à jour `README.md`, une version traduite sera générée automatiquement ! +5. Maintenant, vous pouvez mettre à jour votre `README.md`, une version traduite sera automatiquement générée ! --- -# Demo +# Démo ![](./img/auto-translation.gif) --- -Retour en haut \ No newline at end of file +Revenir en haut \ No newline at end of file diff --git a/README.md b/README.md index 5074e27..e84f591 100644 --- a/README.md +++ b/README.md @@ -5,73 +5,73 @@

* [English](README.md) -* [Traditional Chinese README.md](README.zh-TW.md) -* [Simplified Chinese](README.zh-CN.md) -* [French](README.French.md) +* [繁體中文版README.md](README.zh-TW.md) +* [简体中文](README.zh-CN.md) +* [Française](README.French.md) # Introduction - + > [!NOTE] -> The `v1` version of the translator is implemented through `Linux` third-party packages; the `v2` version is implemented through generative AI for translation. +> `v1` version translator is implemented through `Linux` third-party package; `v2` version is implemented through generative AI for translation -* We all know that writing README documents is time-consuming, but now there is a solution that can save you half the time. This is our `action-translate-readme` +* We all know writing README documents is time-consuming, but now there's a solution to save you half the time. That's our `action-translate-readme` * Translate different language versions of README through **generative AI** -* Automatically submit (commit, push) the translated files through **Github Actions (CI/CD)** +* Automatically **commit and push** the translated files through **GitHub Actions (CI/CD)** -* For example: **Writing** or **modifying** the English version README, automatically generate Traditional Chinese, Simplified Chinese, French, etc. versions of README +* For example: **Write** or **Modify** the English version of the README, automatically generate Traditional Chinese, Simplified Chinese, French... and other versions of the README # How to use ? > [!IMPORTANT] -> Since generative AI models may have issues with translation results each time, it is recommended to execute using branches and finally merge back to the main branch. +> Since the result of the generative AI model's translation may have issues occasionally, it's recommended to perform operations on a branch and finally merge back to the main branch. > [!WARNING] -> If you encounter the following error: `Error: Input required and not supplied: token`, please follow the steps below to ensure that a `Token` has been created, or check if the `Token` has expired! +> If you encounter this error: `Error: Input required and not supplied: token`, please ensure that `Token` is established as per step two below, or check if the `Token` has expired! -1. Click the :star: icon to add this project to your Github repository. +1. Click the :star: icon to add this item to your GitHub repository. -2. Set up your `Github Token` (**required**): +2. Set up your `GitHub Token` (**mandatory**): - 1. [Create a new **`Github Secret Token`**](https://github.com/settings/tokens/new) + 1. [Create a new **`GitHub Secret Token`**](https://github.com/settings/tokens/new) * Settings * Developer settings * Personal access tokens - `Tokens(classic)` * Generate new token - * Select token **lifecycle** - recommended to use **unlimited** - * Select scope: `repo` and `workflow` - * **Keep** your secret token (do not lose it, you will need to paste it later) + * Choose token's **lifetime** - it's recommended to use **permanently** + * Scope selection: `repo` and `workflow` + * **Keep** your secret token (don’t lose it, you’ll need to paste it later) - + - 2. Add Github Token to **`repository secret`** + 2. Add the GitHub Token to **`repository secret`** * In your repository - `settings` * `Securities and variables` * `Actions` * `New repository secret` - * Fill in the label with `token` and name it (e.g., `Action_Bot`) + * Fill in the label and name it with `token` (e.g., `Action_Bot`) - + -3. GPT Translation Model Selection (**optional**) +3. Choose GPT translation model (**optional**) - * `g4f`: **Default** uses **free** `g4f` for OpenAI calls and completes translation tasks. - * `zhipuai`: If you need **free and stable translation**, you can register an account on the [Zhipuai AI platform](https://open.bigmodel.cn/dev/howuse/introduction) and [apply for an API KEY](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys). This is a completely free, no credit card required GPT model solution. - * To use this solution, please follow the method in **step 2-2** to add the Github Token, and add the **Zhipuai AI API KEY to the GitHub Repos Secrets**. + * `g4f`: **Default** is to use **free** `g4f` for OpenAI calls to complete translation tasks. + * `zhipuai`: If you need **free and stable translation**, you can register an account on the [Zhipuai AI Platform](https://open.bigmodel.cn/dev/howuse/introduction) and [apply for an API KEY](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys), which is a completely free GPT model without requiring a credit card. + * To use this option, please follow the method of adding GitHub Token in **step 2-2**, and add **API KEY of Zhipuai AI to GitHub Repos' Secrets**. - * `openai`: **Guaranteed high quality and stable quality**, if you have an OPENAI API KEY, `gpt-4o` will be used as the translation model. - * To use this solution, please follow the method in **step 2-2** to add the Github Token, and add the **OpenAI API KEY to the GitHub Repos Secrets**. + * `openai`: **Guarantee high quality and stable quality**, if you have an OPENAI API KEY, `gpt-4o` will be used as the translation model. + * To use this option, please follow the method of adding GitHub Token in **step 2-2**, and add **API KEY of OpenAI to GitHub Repos' Secrets**. -4. Create your action example in the directory `.github/workflows/your_action.yml`. You can directly copy the following: +4. Create your action example in `.github/workflows/your_action.yml`. You can directly copy the following: ```yaml # .github/workflows/translate.yml @@ -99,19 +99,19 @@ langs: "en,zh-TW,zh-CN,French,Arabic" # You can define any langs ``` - There are a few parameters in the `.yml` to pay special attention to: + Pay attention to several parameters in the `.yml`: - * `token`: GitHub Token used for authorization (added according to step 2). - * `zhipuai`: Zhipuai API, added according to step 3 (optional) - * `openai`: OpenAI API, added according to step 3 (optional) - * `langs`: Specify the languages to translate, make sure to separate different languages with `,`, for example: - * `"en"`: Translate only the English version - * `"en,zh-TW"`: Translate English and Traditional Chinese - * `"French,Arabic"`: Translate French and Arabic + * `token`: GitHub Token for authorizing the operation (added as per step two). + * `zhipuai`: Zhipuai API, added as per step three (optional) + * `openai`: OpenAI API, added as per step three (optional) + * `langs`: Specify the languages to be translated, be sure to separate different languages with `,` such as: + * `"en"`: Translate English version only + * `"en,zh-TW"`: Translate English, Traditional Chinese + * `"French,Arabic"`: Translate French, Arabic > PS: If neither `zhipuai` nor `openai` is added to GitHub Secrets, `g4f` will be used for translation. -5. Now you can update `README.md`, it will automatically generate a translated version! +5. Now you can update `README.md`, and it will automatically generate a translated version! --- diff --git a/README.zh-CN.md b/README.zh-CN.md index 1e9ce33..fdf9a96 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -5,17 +5,16 @@

* [English](README.md) -* [繁体中文版README.md](README.zh-TW.md) +* [繁體中文版README.md](README.zh-TW.md) * [简体中文](README.zh-CN.md) * [Française](README.French.md) -# Introduction - +# 介绍 + > [!NOTE] > `v1`版本的翻译器是通过 `Linux` 第三方套件实现;`v2`版本是通过生成式AI实现翻译 - -* 我们都知道写README文档很费时间,但是现在有一个解决方案可以让你节省一半的时间. 这就是我们的`action-translate-readme` +* 我们都知道写README文档很费时间,但是现在有一个解决方案可以让你节省一半的时间。 这就是我们的`action-translate-readme` * 通过 **生成式AI** 翻译不同语言版本的 README @@ -23,11 +22,10 @@ * 例如: **撰写**或**修改**英文版README,自动生成繁体中文、简体中文、法文...等版本 README - -# How to use ? +# 如何使用? > [!IMPORTANT] -> 由于生成式 AI 模型每次翻译结果都有几率出现问题,建议使用分支执行,最后 Merge 回主支。 +> 由于生成式 AI 模型每次翻译结果都有机率出现问题,建议使用分支执行,最后 Merge 回主支。 > [!WARNING] > 如果你遇到如下错误: `Error: Input required and not supplied: token`,请根据下方步骤二确定已建立 `Token`,或者 `Token` 是否已经过期! @@ -43,7 +41,7 @@ * 生成新令牌 * 选择令牌**生命周期** - 建议直接使用**无限期** * 选择范围:`repo` 和 `workflow` - * **保留**你的secret token(不要丢了,以后需要贴上) + * **保留**你的secret token(不要丢了,以后需要贴上) @@ -59,7 +57,7 @@ 3. GPT 翻译模型选择 (**可选的**) * `g4f`: **默认**使用**免费** `g4f` 来进行 OpenAI 调用,并完成翻译任务。 - * `zhipuai`: 如果需要**免费且稳定翻译**,你可以在[Zhipuai AI平台](https://open.bigmodel.cn/dev/howuse/introduction)注册账号,并[申请 API KEY](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys),这是一个完全免费、无须信用卡的 GPT 模型方案。 + * `zhipuai`: 如果需要**免费且稳定翻译**,你可以在[Zhipuai AI平台](https://open.bigmodel.cn/dev/howuse/introduction)注册账号,并[申请 API KEY](https://open.bigmodel.cn/usercenter/proj-mgmt/apikeys),这是一个完全免费、无需信用卡的 GPT 模型方案。 * 如果要使用该方案,请仿照**步骤2-2**添加 Github Token 的方式,将 **Zhipuai AI的 API KEY 添加至 GitHub Repos 的 Secrets 中**。 @@ -115,10 +113,10 @@ --- -# Demo +# 演示 ![](./img/auto-translation.gif) --- -Back to top \ No newline at end of file +回到顶部 \ No newline at end of file