From aef4cc308932f9b417173445771df7614d4e3b00 Mon Sep 17 00:00:00 2001 From: 96-38 Date: Sun, 30 Oct 2022 09:57:40 +0900 Subject: [PATCH 1/6] docs: add cli tool section --- docs/content/pages/tutorials/translation.md | 66 +++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index 095a9f01..e9812e89 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -32,3 +32,69 @@ Here's an example, for `russian.json`: } } ``` + +# CLI Tool + +Are you tired of manually translating JSON? Do you want an automatic translator? Well then the [nh-translation-helper](https://www.npmjs.com/package/nh-translation-helper) may be for you! + +This tool has the following features: + +- Extract text from XML files and create english.json as the translation source. +- Translate english.json to create a json file for another language. + +This section outlines how to install and use the nh-translation-helper. + +## Installation + +To get started, head over to the [repo for the tool](https://github.com/96-38/nh-translation-helper) and prepare the requirements: + +- Install [Node.js](https://nodejs.org/) >= 12.0.0 + - Install the LTS version. +- Get [DeepL API](https://www.deepl.com/docs-api) Key (Free or Pro) + - Sign up [here](https://www.deepl.com/pro#developer) + +When you are ready, execute the following command in a terminal or command prompt: + +```bash +npm i -g nh-translation-helper +``` + +Now your installation is complete! + +You can use the tool by executing the following command in a terminal or command prompt: + +```bash +nh-translation-helper +``` + +## Generating a english.json from XML + +Select `Generate english.json from XML files` and enter the path of your project folder. + +You are done! a english.json has been generated in "*your_project_root*/translations/". + +## Translating english.json to another language + +Select `Translate JSON (DeepL API key required)` and enter the path of your project folder. ( Note: **Not** the path to the "translations" folder. ) + +Select the source and target languages. + +You are done! a translated json file has been generated in "*your_project_root*/translations/". + +Please enter the DeepL API key for the first time only. The API key will be saved on your PC. + +## Note + +- Not supported extracting UIDictionary and AchievementTranslations + - It is difficult to parse these automatically, and the number of words is small that it would be better to add them by MOD developers manually for better results. + - Translating UIDictionary and AchievementTranslations is supported. + +- Not supported translation into Korean + - Translation is provided by the DeepL API, so it is not possible to translate into languages that are not supported by DeepL. + +- The generated translations are "**not**" perfect + - It is a machine translation though DeepL. The translations on DeepL are known to be too casual or to abbreviate some sentences. + - It will need to be manually corrected to make it a good translation. However, this tool allows you to prototype and is more efficient than starting from scratch. Also, the CDATA tag has been removed from the translated text and must be added manually. + +- Parsing errors may occur when trying to translate manually created JSON files + - In many cases, this is due to a specific comment in the JSON. Please remove the comments and try again. From 0efe455db35241258f11d9daefe957bd76b534ae Mon Sep 17 00:00:00 2001 From: kurosawa <48713768+96-38@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:28:06 +0900 Subject: [PATCH 2/6] Update docs/content/pages/tutorials/translation.md Co-authored-by: Ben C --- docs/content/pages/tutorials/translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index e9812e89..1021f85a 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -35,7 +35,7 @@ Here's an example, for `russian.json`: # CLI Tool -Are you tired of manually translating JSON? Do you want an automatic translator? Well then the [nh-translation-helper](https://www.npmjs.com/package/nh-translation-helper) may be for you! +Are you tired of manually translating JSON? Do you want an automatic translator? Well then the [nh-translation-helper](https://www.npmjs.com/package/nh-translation-helper){ target="_blank" } may be for you! This tool has the following features: From a96bd7e9666e9e0a182aeb4ed322b10cc352b548 Mon Sep 17 00:00:00 2001 From: kurosawa <48713768+96-38@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:28:33 +0900 Subject: [PATCH 3/6] Update docs/content/pages/tutorials/translation.md Co-authored-by: Ben C --- docs/content/pages/tutorials/translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index 1021f85a..599f3635 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -46,7 +46,7 @@ This section outlines how to install and use the nh-translation-helper. ## Installation -To get started, head over to the [repo for the tool](https://github.com/96-38/nh-translation-helper) and prepare the requirements: +To get started, head over to the [repo for the tool](https://github.com/96-38/nh-translation-helper){ target="_blank" } and prepare the requirements: - Install [Node.js](https://nodejs.org/) >= 12.0.0 - Install the LTS version. From de6cf9c9143126e100f6e5a3177ea1ec710823ad Mon Sep 17 00:00:00 2001 From: kurosawa <48713768+96-38@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:28:41 +0900 Subject: [PATCH 4/6] Update docs/content/pages/tutorials/translation.md Co-authored-by: Ben C --- docs/content/pages/tutorials/translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index 599f3635..97bd18e5 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -48,7 +48,7 @@ This section outlines how to install and use the nh-translation-helper. To get started, head over to the [repo for the tool](https://github.com/96-38/nh-translation-helper){ target="_blank" } and prepare the requirements: -- Install [Node.js](https://nodejs.org/) >= 12.0.0 +- Install [Node.js](https://nodejs.org/){ target="_blank" } >= 12.0.0 - Install the LTS version. - Get [DeepL API](https://www.deepl.com/docs-api) Key (Free or Pro) - Sign up [here](https://www.deepl.com/pro#developer) From 1ec138a053d49666f76eceeedf472585104f1ff0 Mon Sep 17 00:00:00 2001 From: kurosawa <48713768+96-38@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:29:11 +0900 Subject: [PATCH 5/6] Update docs/content/pages/tutorials/translation.md Co-authored-by: Ben C --- docs/content/pages/tutorials/translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index 97bd18e5..4a2f0ec4 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -50,7 +50,7 @@ To get started, head over to the [repo for the tool](https://github.com/96-38/nh - Install [Node.js](https://nodejs.org/){ target="_blank" } >= 12.0.0 - Install the LTS version. -- Get [DeepL API](https://www.deepl.com/docs-api) Key (Free or Pro) +- Get [DeepL API](https://www.deepl.com/docs-api){ target="_blank" } Key (Free or Pro) - Sign up [here](https://www.deepl.com/pro#developer) When you are ready, execute the following command in a terminal or command prompt: From 98dc28ec2b26d5e770731ee2b434159e1abb976f Mon Sep 17 00:00:00 2001 From: kurosawa <48713768+96-38@users.noreply.github.com> Date: Sun, 30 Oct 2022 10:29:16 +0900 Subject: [PATCH 6/6] Update docs/content/pages/tutorials/translation.md Co-authored-by: Ben C --- docs/content/pages/tutorials/translation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/pages/tutorials/translation.md b/docs/content/pages/tutorials/translation.md index 4a2f0ec4..e4ebef45 100644 --- a/docs/content/pages/tutorials/translation.md +++ b/docs/content/pages/tutorials/translation.md @@ -51,7 +51,7 @@ To get started, head over to the [repo for the tool](https://github.com/96-38/nh - Install [Node.js](https://nodejs.org/){ target="_blank" } >= 12.0.0 - Install the LTS version. - Get [DeepL API](https://www.deepl.com/docs-api){ target="_blank" } Key (Free or Pro) - - Sign up [here](https://www.deepl.com/pro#developer) + - Sign up [here](https://www.deepl.com/pro#developer){ target="_blank" } When you are ready, execute the following command in a terminal or command prompt: