From 52e9362de2543a6e0f41a71162b40de41c88b4d8 Mon Sep 17 00:00:00 2001 From: gabriel-logan Date: Fri, 17 May 2024 07:27:12 -0300 Subject: [PATCH] Adjusting documentation --- README.md | 25 +++++++----- docs/404.html | 61 ----------------------------- docs/404.md | 7 ++++ docs/README.md | 25 +++++++----- package.json | 2 +- src/updateTranslationMulti/index.ts | 4 +- 6 files changed, 40 insertions(+), 84 deletions(-) delete mode 100644 docs/404.html create mode 100644 docs/404.md diff --git a/README.md b/README.md index 3d201b9..ff941f7 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,6 @@ The Azure Translator Code library is a powerful tool for translating JSON files [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm downloads](https://img.shields.io/npm/dm/azure-translator-code.svg?style=flat-square)](https://npm-stat.com/charts.html?package=azure-translator-code) -

- - Buy Me A Coffee - -

- NPM PAGE: https://www.npmjs.com/package/azure-translator-code GITHUB PAGE: https://github.com/gabriel-logan/Azure-translator-code @@ -24,6 +18,13 @@ As devDependencies ```bash npm install -D azure-translator-code ``` + +You also can use yarn + +```bash +yarn add -D azure-translator-code +``` + or As dependencies @@ -100,11 +101,13 @@ const jsonFile = { translateToMultipleFolders(key, endpoint, location, fromLang, toLangs, jsonFile); // This function will return a folder called multiFolderGeneratedTranslations - - // Translation to a single folder translateToUnicFolder(key, endpoint, location, fromLang, toLangs, jsonFile); // This function will return a folder called unicFolderGeneratedTranslations + +// Update translation from the multiple folders +updateTranslationsMulti(key, endpoint, location, fromLang, toLangs, jsonFile); +// This function will update the translations in the folder called multiFolderGeneratedTranslations ``` #### You can also choose the folder or folder name where you will save the files. @@ -132,15 +135,17 @@ const jsonFile = { translateToMultipleFolders(key, endpoint, location, fromLang, toLangs, jsonFile, 'myFolder'); // This function will return a folder called myFolder - // Translation to a single folder translateToUnicFolder(key, endpoint, location, fromLang, toLangs, jsonFile, 'myFolder/OtherFolder/etc'); // This function will return a folder called ./myFolder/OtherFolder/etc - // Translation to a single folder translateToUnicFolder(key, endpoint, location, fromLang, toLangs, jsonFile, './myFolder/OtherFolder/etc'); // This function will return a folder called ./myFolder/OtherFolder/etc + +// Update translation from the multiple folders +updateTranslationsMulti(key, endpoint, location, fromLang, toLangs, jsonFile, 'myFolder'); +// This function will update the translations in the folder called myFolder ``` Make sure to replace the key and endpoint information with your own Azure access credentials. Ensure that the JSON file and settings are correctly defined according to your needs. diff --git a/docs/404.html b/docs/404.html deleted file mode 100644 index b8badbb..0000000 --- a/docs/404.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - 404 - Página não encontrada - - - -
-

404 - Página não encontrada

-

A página que você está procurando não existe. 😩😩😩

- -
- - diff --git a/docs/404.md b/docs/404.md new file mode 100644 index 0000000..63888bb --- /dev/null +++ b/docs/404.md @@ -0,0 +1,7 @@ +# 404 - Página não encontrada + +A página que você está procurando não existe. 😩😩😩 + +[**Voltar**](https://gabriel-logan.github.io/Azure-translator-code/) + +[**Ir para o GitHub**](https://github.com/gabriel-logan/Azure-translator-code) diff --git a/docs/README.md b/docs/README.md index 3d201b9..ff941f7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,12 +6,6 @@ The Azure Translator Code library is a powerful tool for translating JSON files [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm downloads](https://img.shields.io/npm/dm/azure-translator-code.svg?style=flat-square)](https://npm-stat.com/charts.html?package=azure-translator-code) -

- - Buy Me A Coffee - -

- NPM PAGE: https://www.npmjs.com/package/azure-translator-code GITHUB PAGE: https://github.com/gabriel-logan/Azure-translator-code @@ -24,6 +18,13 @@ As devDependencies ```bash npm install -D azure-translator-code ``` + +You also can use yarn + +```bash +yarn add -D azure-translator-code +``` + or As dependencies @@ -100,11 +101,13 @@ const jsonFile = { translateToMultipleFolders(key, endpoint, location, fromLang, toLangs, jsonFile); // This function will return a folder called multiFolderGeneratedTranslations - - // Translation to a single folder translateToUnicFolder(key, endpoint, location, fromLang, toLangs, jsonFile); // This function will return a folder called unicFolderGeneratedTranslations + +// Update translation from the multiple folders +updateTranslationsMulti(key, endpoint, location, fromLang, toLangs, jsonFile); +// This function will update the translations in the folder called multiFolderGeneratedTranslations ``` #### You can also choose the folder or folder name where you will save the files. @@ -132,15 +135,17 @@ const jsonFile = { translateToMultipleFolders(key, endpoint, location, fromLang, toLangs, jsonFile, 'myFolder'); // This function will return a folder called myFolder - // Translation to a single folder translateToUnicFolder(key, endpoint, location, fromLang, toLangs, jsonFile, 'myFolder/OtherFolder/etc'); // This function will return a folder called ./myFolder/OtherFolder/etc - // Translation to a single folder translateToUnicFolder(key, endpoint, location, fromLang, toLangs, jsonFile, './myFolder/OtherFolder/etc'); // This function will return a folder called ./myFolder/OtherFolder/etc + +// Update translation from the multiple folders +updateTranslationsMulti(key, endpoint, location, fromLang, toLangs, jsonFile, 'myFolder'); +// This function will update the translations in the folder called myFolder ``` Make sure to replace the key and endpoint information with your own Azure access credentials. Ensure that the JSON file and settings are correctly defined according to your needs. diff --git a/package.json b/package.json index d7de6c6..d4d0c8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "azure-translator-code", - "version": "1.0.8", + "version": "1.1.0", "description": "Azure Cognitive Services Translator Text API Code for Use with Common Languages", "author": { "name": "Gabriel Logan" diff --git a/src/updateTranslationMulti/index.ts b/src/updateTranslationMulti/index.ts index bf13501..c091158 100644 --- a/src/updateTranslationMulti/index.ts +++ b/src/updateTranslationMulti/index.ts @@ -48,8 +48,8 @@ interface TranslationType { If you need, copy this structure to get better then make your modification * * @description This function checks the json with the already existing translations and adds only the non-existing translations to the file, this serves to save data. - *Otherwise it works the same as the other 2 functions - * + * Otherwise it works the same as the other 2 functions + * * @param [folderNamePath='multiFolderGeneratedTranslations'] If it is undefined, it will be associated by default: multiFolderGeneratedTranslations You can use this like: 'myfoldername' or 'myfoldername/otherfolder' or './myfoldername/etcfolder' @IMPORTANT Saving always starts from the project root folder.