Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can create al locales i18n folders? #68

Open
johnfelipe opened this issue Jun 5, 2022 · 3 comments
Open

how can create al locales i18n folders? #68

johnfelipe opened this issue Jun 5, 2022 · 3 comments

Comments

@johnfelipe
Copy link

johnfelipe commented Jun 5, 2022

i have en folder, and i need all languages options in locales folder...

@johnfelipe
Copy link
Author

cd locales/
mkdir -p af sq ar eu bg be ca hr cs da nl eo et fo fi fr gl de el iw hu is Eskimo ga it ja ko lv lt mk mt no pl pt ro ru gd sr sr sk sl es sv tr uk

and next

root@ubuntu21:~/json-autotranslate/locales# npx json-autotranslate -i locales -s azure -c xxxxxxxxx,eastus -m i18next

An error has occurred:
ENOENT: no such file or directory, scandir '/root/json-autotranslate/locales/locales'
Error: ENOENT: no such file or directory, scandir '/root/json-autotranslate/locales/locales'
	at Object.readdirSync (node:fs:1405:3)
	at Object.exports.getAvailableLanguages (/root/json-autotranslate/node_modules/json-autotranslate/lib/util/file-system.js:38:31)
	at /root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:122:56
	at step (/root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:68:23)
	at Object.next (/root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:49:53)
	at /root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:43:71
	at new Promise (<anonymous>)
	at __awaiter (/root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:39:12)
	at translate (/root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:115:12)
	at Object.<anonymous> (/root/json-autotranslate/node_modules/json-autotranslate/lib/index.js:345:1)

how solve?

@johnfelipe
Copy link
Author

root@ubuntu21:~/json-autotranslate# cd locales/
root@ubuntu21:~/json-autotranslate/locales# mkdir -p af sq ar eu bg be ca hr cs da nl eo et fo fi fr gl de el iw hu is Eskimo ga it ja ko lv lt mk mt no pl pt ro ru gd sr sr sk sl es sv tr uk
root@ubuntu21:~/json-autotranslate/locales# cd ..
root@ubuntu21:~/json-autotranslate# npx json-autotranslate -i locales -s azure -c xxxxxxxxxxx,eastus -m i18next
Found 44 target language(s):
-> Eskimo, af, ar, be, bg, ca, cs, da, de, el, eo, es, et, eu, fi, fo, fr, ga, gd, gl, hr, hu, is, it, iw, ja, ko, lt, lv, mk, mt, nl, no, pl, pt, ro, ru, sk, sl, sq, sr, sv, tr, uk

🏭 Loading source files...
├── admin.json (key-based)
├── common.json (key-based)
├── editor.json (key-based)
├── social.json (key-based)
├── user.json (key-based)
└── Done

✨ Initializing Azure...
└── Done

🔍 Looking for key-value inconsistencies in source files...
└── No inconsistencies found

🔍 Looking for invalid keys in source files...
└── No invalid keys found

🙈 Azure doesn't support Eskimo. Skipping this language.

💬 Translating strings from en to af...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

💬 Translating strings from en to ar...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

🙈 Azure doesn't support be. Skipping this language.

💬 Translating strings from en to bg...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

💬 Translating strings from en to ca...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

💬 Translating strings from en to cs...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

💬 Translating strings from en to da...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

💬 Translating strings from en to de...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

💬 Translating strings from en to el...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache) (+558)
├── Translating social.json (0 changes from cache) (+156)
├── Translating user.json (0 changes from cache) (+253)
└── All strings have been translated.

🙈 Azure doesn't support eo. Skipping this language.

💬 Translating strings from en to es...
├── Translating admin.json (0 changes from cache) (+330)
├── Translating common.json (0 changes from cache) (+62)
├── Translating editor.json (0 changes from cache)
An error has occurred:
Azure Translation failed: {"error":{"code":429001,"message":"The server rejected the request because the client has exceeded request limits."}}
Error: Azure Translation failed: {"error":{"code":429001,"message":"The server rejected the request because the client has exceeded request limits."}}
	at AzureTranslator.<anonymous> (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:128:35)
	at step (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:33:23)
	at Object.next (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:14:53)
	at fulfilled (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:5:58)
	at runMicrotasks (<anonymous>)
	at processTicksAndRejections (node:internal/process/task_queues:96:5)

how prevent that exceed request limits?

@leolabs
Copy link
Owner

leolabs commented Jun 9, 2022

Currently, json-autotranslate doesn't have support for handling this, but you should be able to just run the command multiple times because it will skip the items you already translated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants