From 89847e25e5bba32f7611a5839310229c860bdcac Mon Sep 17 00:00:00 2001 From: Continuous Integration Date: Mon, 25 Sep 2023 06:30:20 +0000 Subject: [PATCH] Auto-translate README --- README.Arabic.md | 1 + README.French.md | 53 +++++++++++++++++++++++++ README.md | 101 ++++++++++++++++------------------------------- README.zh-CN.md | 2 + 4 files changed, 91 insertions(+), 66 deletions(-) create mode 100644 README.Arabic.md create mode 100644 README.French.md create mode 100644 README.zh-CN.md diff --git a/README.Arabic.md b/README.Arabic.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/README.Arabic.md @@ -0,0 +1 @@ + diff --git a/README.French.md b/README.French.md new file mode 100644 index 0000000..91afd78 --- /dev/null +++ b/README.French.md @@ -0,0 +1,53 @@ + +第二次翻譯結果: + +## Comment exécuter ? + +1. Ajoutez ce projet à votre dépôt Github en cliquant sur l'icône :star:. + +2. Configurez votre `Github Token` : + + * [Créez un nouveau **`Github Secret Token`**](https://github.com/settings/tokens/new) + * Paramètres + * Paramètres du développeur + * Jetons d'accès personnels - `Tokens(classic)` + * Générer un nouveau jeton + * Choisissez le champ d'application : `repo` et `workflow` + * **Conservez** votre jeton secret (ne le perdez pas, vous en aurez besoin plus tard) + + * Créez un nouveau **`repository secret`** + * Dans votre dépôt - `settings` + * `Securits and variables` + * `Actions` + * `New repository secret` + * Remplissez l'étiquette avec le `token` et donnez-lui un nom (par exemple : `Action_Bot`) + +4. Créez le **README** dans la langue de votre choix : `README.md`, `READM.zh-TW.md`, ... + +5. Créez votre exemple d'action dans le répertoire `.github/workflows/your_action.yml`. : + + ```yaml + # .github/workflows/translate.yml + name: Traduire Readme + + on: + push: + branches: ['**'] + + jobs: + translate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 3 + + - name: Traduction automatique + uses: Lin-jun-xiang/action-translate-readme@v2 # Basé sur le tag + with: + token: ${{ secrets.Action_Bot }} # Basé sur le nom de l'étape 2 + g4f_provider: g4f.Provider.DeepAi # Vous pouvez changer ce fournisseur + ``` + +6. Vous pouvez maintenant mettre à jour le `README.md`, il générera automatiquement une version traduite ! \ No newline at end of file diff --git a/README.md b/README.md index c4387e2..e78bc32 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,52 @@ -# action-translate-readme - -[English Version](README.md) | [Chinese Version README.md](README.zh-TW.md) - -# What's changed for action-translate-readme? - -With the emergence of ChatGPT, the author thought that the translation task of this project could be handed over to GPT for implementation. Through the open source project [`gpt4free`](https://github.com/xtekky/gpt4free), we can realize the free GPT API and hope to enhance the translation ability of this project! - -* Version 1 translation method: implemented through third-party Linux packages (`translation.sh`) - * Translation effect: poor, similar to Google Translate - * Translation speed: slow - * Stability: high, can ensure correct translation every time - -* Version 2 translation method: using GPT for translation task (`translation.py`) - * Translation effect: good - * Translation speed: fast or slow - * Stability: low - Since `gpt4free` uses reverse engineering to realize free API calls, the calling process may encounter abnormal problems. The author added `retry` technology (they will be executed again when abnormal events occur) when calling the API function to avoid translation failure. As a result, the translation speed will increase with the number of retries. - -> Please **note** that there are [different providers](https://github.com/xtekky/gpt4free#models) in `gpt4free`, which are the sources that provide API calls. If you cannot use the automatic translation tool of this project normally, the problem usually comes from the provider currently used and is **inactive**. Therefore, you can set the [parameter](.github\workflows\translate-readme.yml) yourself in your `translate-readme.yml` file (default is `g4f.Provider.DeepAi`). -> -> In addition, since it is a **generative AI** technology, it cannot guarantee that each translation is correct. If the translation effect is not good, you can repeat it several times. +您好,這是Bing。我可以幫您完成翻譯的部分。以下是我翻譯的結果: +# action-translate-readme -# Introduction +[英文版](README.md) | [中文版 README.md](README.zh-TW.md) -* We all know that writing documents takes a lot of time, but now there is a solution that can save you half of the time. This is our `action-translate-readme`. -* With this tool, you can automatically translate the `README.md` file, not only can translate, but also translates various elements such as **inline code, emojis, code blocks, HTML tags and links.** +# 簡介 -* Its operating principle is to achieve automation through `Github Actions`. Just push the updated README file, and the translated README (zh or en) file can be automatically updated. +* 我們都知道,撰寫 README 文件需要花費很多時間,但現在有一個解決方案可以節省一半的時間。這就是我們的 `action-translate-readme`。 -* Continuous integration (CI) +* 使用 `gpt3.5` 翻譯 README 的不同語言版本。 -* **Automatically translate the language of README through Github Action** +* 通過 **Github Actions (CI/CD)** 自動提交和推送翻譯後的文件。 -* Update `README.md` and push it. This action will automatically update `README.zh-TW.md` - (Updating `README.zh-TW.md` will automatically update `README.md`) +* 例如:**撰寫**或**修改**英文版的 README,並自動生成繁體中文、簡體中文、法文等版本的 README。 -* Half of the time spent on writing documents is saved. +注意:版本 1 的翻譯是通過 `Linux` 中的第三方套件實現的;版本 2 是通過使用 [`g4f`](https://github.com/xtekky/gpt4free) 免費調用 openai api 實現的。 -# Features -* Untranslated: - * Inline code (`inline_code`) - * Used for emoji - * Code block - * HTML tags - * Link +# 如何使用? -# How to use? +1. 點擊 :star: 圖標,將此項目添加到您的 Github 倉庫中。 -1. Click on the :star: icon to add this item to your Github repository. +2. 設置您的 `Github Token`: -2. Set your `Github Token`: - * [Create a new **`Github Secret Token`**](https://github.com/settings/tokens/new) - * Set - * Developer settings - * Personal access tokens - `Tokens(classic)` - * Generate new token - * Choose scope: `repo` and `workflow` - * **Keep** your secret token (do not throw it away, it needs to be pasted later) - + * [創建一個新的 **`Github Secret Token`**](https://github.com/settings/tokens/new) + * 配置 + * 開發者設置 + * 個人訪問令牌 - `Tokens(classic)` + * 生成新令牌 + * 選擇範圍:`repo` 和 `workflow` + * **保留** 您的秘密令牌(不要丟失,您稍後需要粘貼它) + - - * Create a new **`repository secret`** - * In your repository - `settings` + + * 創建一個新的 **`repository secret`** + * 在您的倉庫 - `settings` * `Securits and variables` * `Actions` * `New repository secret` - * Fill in the tag and name it (eg: `Action_Bot`) in `token` + * 填寫標籤為 `token` 並命名(例如:`Action_Bot`) - -3. Create the README language you want: `README.md`, `READM.zh-TW.md`,... -4. Create your action example in directory `.github/workflows/your_action.yml`. +4. 創建您想要的 **README** 語言:`README.md`, `READM.zh-TW.md`, ... + +5. 在目錄 `.github/workflows/your_action.yml` 中創建您的 action 示例: ``` # .github/workflows/translate.yml @@ -95,25 +66,23 @@ With the emergence of ChatGPT, the author thought that the translation task of t fetch-depth: 3 - name: Auto Translate - uses: Lin-jun-xiang/action-translate-readme@v2 # Based on the tag + uses: Lin-jun-xiang/action-translate-readme@v2 # 根據標籤 with: - token: ${{ secrets.Action_Bot }} # Based on step2 name - g4f_provider: g4f.Provider.DeepAi # You can change this provider + token: ${{ secrets.Action_Bot }} # 根據步驟2名稱 + g4f_provider: g4f.Provider.DeepAi # 您可以更改此提供者 ``` -5. Now you can update the `README.md`, and a translated version will be generated automatically! +6. 現在您可以更新 `README.md`,它將自動生成翻譯版本! --- -# Demo +# 演示 ![](./img/auto-translation.gif) --- -# Results of Test Document - -* View [test document](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) -* Update the test document using our tool +# 測試文檔結果 -Back to top \ No newline at end of file +* 查看 [測試文檔](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) +* 使用我們的工具更新測試文 \ No newline at end of file diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 0000000..075d1d9 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,2 @@ + +Hmm, I am not sure. Email support@chatbase.co for more info. \ No newline at end of file