From cd39cec2435ddd2b6522192c85f0759774a3d233 Mon Sep 17 00:00:00 2001 From: Continuous Integration Date: Tue, 5 Dec 2023 05:43:42 +0000 Subject: [PATCH] Auto-translate README --- README.Arabic.md | 100 ++++------------------------------------------- README.French.md | 69 ++++++++++++++++---------------- README.md | 89 ++++++----------------------------------- README.zh-CN.md | 79 +++---------------------------------- 4 files changed, 62 insertions(+), 275 deletions(-) diff --git a/README.Arabic.md b/README.Arabic.md index a375680..ec09734 100644 --- a/README.Arabic.md +++ b/README.Arabic.md @@ -11,104 +11,18 @@ * [عربى](README.Arabic.md) -# المقدمة +# مقدمة > [!NOTE] -> إن مترجم الإصدار `v1` تم تنفيذه باستخدام حزمة الطرف الثالث `Linux`؛ بينما يتم تنفيذ الإصدار `v2` باستخدام [`g4f`](https://github.com/xtekky/gpt4free) لاستدعاء واجهة برمجة تطبيقات openai مجانًا للترجمة. +> تم تنفيذ مترجم الإصدار `v1` باستخدام حزمة طرف ثالث في `Linux` ؛ تم تنفيذ الإصدار `v2` باستخدام مكالمة مجانية لواجهة برمجة تطبيقات openai عن طريق [`g4f`](https://github.com/xtekky/gpt4free) +* نعلم جميعًا أن كتابة وثائق README تستغرق وقتًا طويلاً ، ولكن الآن هناك حلاً يمكنك توفير نصف الوقت. هذا هو `action-translate-readme` الخاص بنا -* نعلم جميعًا أن كتابة وثيقة README تستغرق وقتًا طويلاً ، ولكن الآن هناك حلاً يمكنك من خلاله توفير نصف الوقت. هذا هو `action-translate-readme` لدينا. +* ترجمة الإصدارات بلغات مختلفة من README باستخدام `gpt3.5` -* قم بترجمة إصدارات README المختلفة بواسطة `gpt3.5`. +* تحميل الوثائق المترجمة تلقائيًا باستخدام **Github Actions(CI/CD) commit و push** -* تقديم **Github Actions(CI/CD) للترجمة التلقائية (commit، push)** للملفات المترجمة. +* على سبيل المثال: **الكتابة** أو **تعديل** النسخة الإنجليزية من README ، وتوليد النسخة المترجمة التقليدية الصينية والنسخة المبسطة الصينية والفرنسية ... الخ README -* على سبيل المثال: **كتابة** أو **تعديل** إصدار README باللغة الإنجليزية ، ستتم إنشاء إصدارات README باللغة التايوانية التقليدية واللغة الصينية المبسطة واللغة الفرنسية وما إلى ذلك. - -# كيفية الاستخدام؟ - - -> [!IMPORTANT] -> نظرًا لأن `gpt3.5` هو نموذج AI القائم على الإنتاج ، فإنه يحتمل أن تكون هناك مشاكل في كل نتيجة للترجمة ، ويُنصح باستخدام الفروع للاختبار ومحاولة عدة مرات. - -> [!WARNING] -> إذا واجهت الخطأ التالي: `Error: Input required and not supplied: token`، يُرجى التأكد من إنشاء `Token` وفقًا للخطوة الثانية ، أو التحقق مما إذا كان الـ `Token` قد انتهت صلاحيته! - -1. انقر على رمز النجمة :star: لإضافة هذا المشروع إلى مستودع Github الخاص بك. - -2. قم بتعيين `Github Token` الخاص بك: - - * [أنشئ **`Github Secret Token`** جديد](https://github.com/settings/tokens/new) - * قم بإعداده - * إعدادات المطور - * رمز الوصول الشخصي - `Tokens(classic)` - * إنشاء رمز جديد - * اختيار **دورة حياة الرمز** - يُوصى باستخدام **غير محددة المدة** - * اختيار النطاق: `repo` و `workflow` - * **احتفظ** برمز الوصول السري الخاص بك (لا تفقده ، ستحتاج إليه في المستقبل) - - - - * أنشئ **`repository secret`** جديدًا - * في مستودعك - `settings` - * `Securits and variables` - * `Actions` - * `New repository secret` - * قم بتعبئة علامة `token` وتسميتها (على سبيل المثال: `Action_Bot`) - - - -3. قم بإنشاء مثال الإجراء الخاص بك في الدليل `.github/workflows/your_action.yml`. يمكنك نسخه مباشرة كما يلي: - - ``` - # .github/workflows/translate.yml - name: Translate Readme - - on: - push: - branches: ['**'] - - jobs: - translate: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 3 - - - name: Auto Translate - uses: Lin-jun-xiang/action-translate-readme@v2 # Based on the tag - with: - token: ${{ secrets.Action_Bot }} # Based on step2 name - g4f_provider: g4f.Provider.DeepAi # You can change this provider - langs: "en,zh-TW,zh-CN,French,Arabic" # You can define any langs - ``` - - هناك ثلاثة معلمات تحتاج إلى إيلاء اهتمام خاص في الملف `.yml`: - - * `token`: الرمز الذي تم إنشاؤه في الخطوة 2 في المستودع - * `g4f_provider`: مزود gpt ، يُرجى الرجوع إلى المزيد من التفاصيل في ال[رابط](https://github.com/xtekky/gpt4free/tree/main#gpt-35--gpt-4) - * `langs`: الإصدارات التي تريد إنشاءها ، يجب عليك تحديد اللغات المختلفة بفاصلة `,` ، على سبيل المثال: - * `"en"`: ترجمة الإصدار الإنجليزي فقط - * `"en,zh-TW"`: ترجمة الإصدار الإنجليزي والإصدار التايواني التقليدي - * `"French,Arabic"`: ترجمة الإصدار الفرنسي والإصدار العربي - -4. يمكنك الآن تحديث `README.md` وسيتم إنشاء إصدار مترجم تلقائيًا! - ---- - -# عرض توضيحي - -![](./img/auto-translation.gif) - ---- - -# نتائج وثيقة الاختبار - -* شاهد [وثيقة الاختبار](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) -* استخدم أداةنا لتحديث وثيقة الاختبار - -العودة إلى الأعلى --------------------------------- \ No newline at end of file +# كيفية استخ \ No newline at end of file diff --git a/README.French.md b/README.French.md index cc28370..33f3e50 100644 --- a/README.French.md +++ b/README.French.md @@ -1,3 +1,4 @@ +```markdown # action-translate-readme

@@ -14,53 +15,53 @@ # Introduction > [!NOTE] -> La version `v1` du traducteur est implémentée à l'aide d'un package tiers `Linux`; la version `v2` est mise en œuvre en appelant gratuitement l'API openai à l'aide de [`g4f`](https://github.com/xtekky/gpt4free). +> `v1`版本的翻譯器是透過 `Linux` 第三方套件實現;`v2`版本是透過 [`g4f`](https://github.com/xtekky/gpt4free) 免費調用 openai api 實現翻譯 -* Nous savons tous que rédiger une documentation README prend beaucoup de temps, mais il existe maintenant une solution qui vous permet d'économiser la moitié de votre temps. C'est notre `action-translate-readme`. +* Nous savons tous que rédiger un README prend beaucoup de temps, mais maintenant, il existe une solution qui peut vous faire gagner la moitié de ce temps. C'est notre `action-translate-readme`. -* Traduisez différentes versions de README dans différentes langues en utilisant `gpt3.5`. +* Traduisez les différentes versions de README en utilisant `gpt3.5` -* Soumettez automatiquement (commit, push) les fichiers traduits à l'aide de **Github Actions (CI/CD)**. +* Automatisez la soumission (commit, push) des fichiers traduits avec **Github Actions (CI/CD)** -* Par exemple: **Écrivez** ou **modifiez** la version anglaise de README, et les versions en chinois traditionnel, en chinois simplifié, en français, etc., seront générées automatiquement. +* Par exemple : **écrire** ou **modifier** la version anglaise du README, générer automatiquement des versions en chinois traditionnel, en chinois simplifié, en français, etc. -# Comment utiliser ? +# How to use ? > [!IMPORTANT] -> Comme `gpt3.5` est un modèle d'IA génératif, il y a une probabilité que chaque résultat de traduction présente des problèmes. Il est recommandé de tester sur une branche et d'essayer plusieurs fois. +> Étant donné que `gpt3.5` est un modèle IA génératif, chaque résultat de traduction a une probabilité d'avoir des problèmes. Il est recommandé d'effectuer des tests de branches et d'essayer plusieurs fois. > [!WARNING] -> Si vous rencontrez l'erreur suivante : `Error: Input required and not supplied: token`, veuillez suivre l'étape 2 pour vérifier si vous avez créé le `Token` ou si le `Token` est expiré ! +> Si vous rencontrez une erreur telle que : `Error: Input required and not supplied: token`, veuillez vérifier si vous avez créé un `Token` selon l'étape deux, ou si le `Token` a expiré ! 1. Cliquez sur l'icône :star: pour ajouter ce projet à votre dépôt Github. 2. Configurez votre `Github Token` : * [Créez un nouveau **`Github Secret Token`**](https://github.com/settings/tokens/new) - * Réglages - * Réglages développeur + * Réglage + * Paramètres des développeurs * Jetons d'accès personnels - `Tokens(classic)` * Générer un nouveau jeton - * Choisissez la **durée de vie** du jeton - il est recommandé d'utiliser **illimité** - * Choisissez les autorisations : `repo` et `workflow` - * **Conservez** votre secret token (ne le perdez pas, vous en aurez besoin plus tard) - + * Choisissez la **durée de vie** du jeton - il est recommandé d'utiliser **indéfiniment** + * Choisissez la portée : `repo` et `workflow` + * **Gardez** votre jeton secret (ne le perdez pas, vous en aurez besoin plus tard) + * Créez un nouveau **`repository secret`** - * Dans votre dépôt - Paramètres - * Sécurité et variables - * Actions - * Nouveau secret de dépôt - * Étiquetez et nommez le secret (par ex : `Action_Bot`) + * Dans votre dépôt - `paramètres` + * `Sécurité et variables` + * `Actions` + * `Nouveau secret du dépôt` + * Tapez `token` dans libellé et nommez-le (ex : `Action_Bot`) -3. Créez votre exemple d'action dans le répertoire `.github/workflows/your_action.yml`. Vous pouvez simplement copier le contenu suivant : +3. Dans le répertoire `.github/workflows/your_action.yml`, créez votre exemple d'action, vous pouvez simplement copier ceci : - ``` + ```yaml # .github/workflows/translate.yml name: Translate Readme @@ -83,18 +84,20 @@ token: ${{ secrets.Action_Bot }} # Basé sur le nom de l'étape 2 g4f_provider: g4f.Provider.DeepAi # Vous pouvez changer ce fournisseur langs: "en,zh-TW,zh-CN,French,Arabic" # Vous pouvez définir n'importe quelles langues + # openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Si vous passez la clé d'API openai, il utilisera openai gpt au lieu de gpt4free ``` - Il y a trois paramètres dans le `.yml` à noter : - - * `token` : le token créé dans l'étape 2 dans le repo - * `g4f_provider` : le fournisseur de gpt, pour en savoir plus, veuillez consulter le [lien](https://github.com/xtekky/gpt4free/tree/main#gpt-35--gpt-4) - * `langs` : les versions linguistiques que vous souhaitez générer, veillez à séparer les différentes langues par des virgules, 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 +> [!NOTE] +> Il y a quelques paramètres dans le `.yml` à surveiller : +> * `token` **(obligatoire)** : le token créé dans le repos selon l'étape 2 +> * `g4f_provider` **(optionnel)** : le fournisseur de gpt, pour plus de détails, consultez le [lien](https://github.com/xtekky/gpt4free/tree/main#gpt-35--gpt-4) +> * `langs` **(obligatoire)** : les versions linguistiques que vous souhaitez générer, assurez-vous de séparer les langues par des virgules, 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 +> * `openai_api_key` **(optionnel)** : si vous souhaitez utiliser l'API openai gpt, vous pouvez créer une clé API openai de la même manière que l'étape 2, **n'oubliez pas de ne pas inclure directement la clé dans le fichier yml, pour éviter toute fuite de données !** -4. Maintenant, vous pouvez mettre à jour `README.md`, et une version traduite sera générée automatiquement ! +4. Maintenant, vous pouvez mettre à jour `README.md`, cela générera automatiquement une version traduite ! --- @@ -106,8 +109,8 @@ # Résultats du document de test -* Voir [le document de test](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) -* Mettez à jour le document de test avec notre outil +* Consultez le [document de test](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) +* Utilisez notre outil pour mettre à jour le document de test Retour en haut --------------------------------- \ No newline at end of file +``` \ No newline at end of file diff --git a/README.md b/README.md index dd4ec8a..2ec3b8b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

* [English](README.md) -* [Traditional Chinese Version README.md](README.zh-TW.md) +* [Traditional Chinese version](README.zh-TW.md) * [Simplified Chinese](README.zh-CN.md) * [French](README.French.md) * [Arabic](README.Arabic.md) @@ -14,100 +14,37 @@ # Introduction > [!NOTE] -> The translator of version `v1` is implemented through a third-party package on `Linux`; version `v2` is implemented by calling the OpenAI API for free through [`g4f`](https://github.com/xtekky/gpt4free). +> The `v1` version of the translator is implemented through a third-party package on Linux; the `v2` version is implemented by calling the openai api for translation through [`g4f`](https://github.com/xtekky/gpt4free). -* We all know that writing README documentation takes a lot of time, but now there is a solution that can save you half the time. This is our `action-translate-readme`. +* We all know that writing README documents takes a lot of time, but now there is a solution that can save you half the time. This is our `action-translate-readme`. -* Translate different language versions of README using `gpt3.5`. +* Translate README into different language versions using `gpt3.5`. -* Automatically commit (commit, push) the translated files through **Github Actions (CI/CD)**. +* Automatically commit and push the translated files through **Github Actions (CI/CD)**. -* For example: **Write** or **modify** the English version of README, and automatically generate versions of README in Traditional Chinese, Simplified Chinese, French, etc. +* For example: **Write** or **modify** the English version of the README, and automatically generate versions in Traditional Chinese, Simplified Chinese, French, and other languages. # How to use? - > [!IMPORTANT] -> Since `gpt3.5` is a generative AI model, there is a chance of problems with the translation results each time. It is recommended to use branch testing and try several times. +> Since `gpt3.5` belongs to a generative AI model, there is a probability of problems in the translation results each time. It is recommended to use branch testing and try several times. > [!WARNING] -> If you encounter the following error: `Error: Input required and not supplied: token`, please follow step two to ensure that the `Token` has been created or whether the `Token` has expired! +> If you encounter the following error: `Error: Input required and not supplied: token`, please follow step 2 to ensure that the `Token` has been created or whether the `Token` has expired! -1. Click on the :star: icon to add this project to your Github repository. +1. Click the :star: icon to add this project to your Github repository. 2. Set up your `Github Token`: * [Create a new **`Github Secret Token`**](https://github.com/settings/tokens/new) - * Setting + * Set * Developer settings * Personal access tokens - `Tokens (classic)` * Generate new token - * Choose token **lifespan** - it is recommended to use **unlimited** + * Choose the token **lifetime** - it is recommended to use **infinite** * Choose scopes: `repo` and `workflow` - * **Keep** your secret token (do not lose it, you will need to paste it later) + * **Keep** your secret token (don't lose it, you'll need it later) - - - * Create a new **`repository secret`** - * In your repository - `settings` - * `Securits and variables` - * `Actions` - * `New repository secret` - * Fill in the label with `token` and name it (eg: `Action_Bot`) - - - -3. Create an example of your action in the directory `.github/workflows/your_action.yml`. You can directly copy the following: - - ``` - # .github/workflows/translate.yml - name: Translate Readme - - on: - push: - branches: ['**'] - - jobs: - translate: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 3 - - - name: Auto Translate - uses: Lin-jun-xiang/action-translate-readme@v2 # Based on the tag - with: - token: ${{ secrets.Action_Bot }} # Based on step2 name - g4f_provider: g4f.Provider.DeepAi # You can change this provider - langs: "en,zh-TW,zh-CN,French,Arabic" # You can define any langs - ``` - - There are three parameters in `.yml` that need special attention: - - * `token`: The token created in the repos based on step 2. - * `g4f_provider`: The provider of gpt, for more information, please refer to the [link](https://github.com/xtekky/gpt4free/tree/main#gpt-35--gpt-4) - * `langs`: The language versions you want to generate, be 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 - -4. Now you can update `README.md`, and it will automatically generate a translated version! - ---- - -# Demo - -![](./img/auto-translation.gif) - ---- - -# Results of Test Document - -* View the [test document](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) -* Use our tool to update the test document - -Back to top \ No newline at end of file + - - * 创建一个新的 **`repository secret`** - * 在您的存储库中 - `settings` - * `Securits and variables` - * `Actions` - * `New repository secret` - * 按`token`填写标签并命名(eg: `Action_Bot`) - - - -3. 在目录 `.github/workflows/your_action.yml`. 中创建您的操作示例,你可以直接复制以下: - - ``` - # .github/workflows/translate.yml - name: Translate Readme - - on: - push: - branches: ['**'] - - jobs: - translate: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 3 - - - name: Auto Translate - uses: Lin-jun-xiang/action-translate-readme@v2 # Based on the tag - with: - token: ${{ secrets.Action_Bot }} # Based on step2 name - g4f_provider: g4f.Provider.DeepAi # You can change this provider - langs: "en,zh-TW,zh-CN,French,Arabic" # You can define any langs - ``` - - 在`.yml`中有三个参数要特别注意: - - * `token`: 根据步骤2,在repos中建立的token - * `g4f_provider`: gpt 的提供者,更多请参考[链接](https://github.com/xtekky/gpt4free/tree/main#gpt-35--gpt-4) - * `langs`: 想要产生的语言版本,务必用`,`分隔不同语言,例如: - * `"en"`: 仅翻译英文版 - * `"en,zh-TW"`: 翻译英文、繁體中文 - * `"French,Arabic"`: 翻译法文、阿拉伯文 - -4. 现在你可以更新 `README.md`,它会自动生成一个翻译版本! - ---- - -# 演示 - -![](./img/auto-translation.gif) - ---- - -#测试文档结果 - -* 查看[测试文档](https://github.com/Lin-jun-xiang/vscode-extensions-best/tree/main) -* 使用我们的工具更新测试文档 - -返回顶部