fkirc / attranslate

A command line tool for translating JSON, YAML, CSV, ARB, XML (via a CLI)
https://www.npmjs.com/package/attranslate
Other
336 stars 27 forks source link

NOT BUG: how can translate all folder with yml files to other folder with another lang? #236

Closed johnfelipe closed 1 year ago

johnfelipe commented 2 years ago

SNAG-0095

al files is in en folder then i need all files to es folder

with will be command for google and azure?

GOOGLE WORKS:

attranslate --srcFile=general.yml --srcLng=en --srcFormat=yaml --targetFile=general-es.yml --targetLng=es --targetFormat=yaml --service=google-translate --serviceConfig=traducciones-352415-79659df1c6f1.json

fkirc commented 2 years ago

Hi, Maybe the Readme-file is not clear about it, but the Azure-service expects you to pass an API-key as serviceConfig (not a JSON-filename!).

johnfelipe commented 2 years ago

attranslate --srcFile=general.yml --srcLng=en --srcFormat=yaml --targetFile=general-es.yml --targetLng=es --targetFormat=yaml --service=google-translate --serviceConfig=traducciones-352415-79659df1c6f1.json

can you share me command with azure for translate entire folder?

fkirc commented 2 years ago

I cannot share a complete Azure-command because I do not have an Azure-API-key right now. But once you have a valid API-key, you can pass this API-key via —serviceConfig=<yourAPIKey> —service=azure. No other changes should be necessary.

johnfelipe commented 2 years ago

but for folder?

El lun, 8 ago 2022 a las 19:17, Felix K @.***>) escribió:

I cannot share a complete Azure-command because I do not have an Azure-API-key right now. But once you have a valid API-key, you can pass this API-key via —serviceConfig= —service=azure. No other changes should be necessary.

— Reply to this email directly, view it on GitHub https://github.com/fkirc/attranslate/issues/236#issuecomment-1208750478, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFBAESH5RG3ZKNU7POTVYGPRHANCNFSM55WE3ERA . You are receiving this because you authored the thread.Message ID: @.***>

fkirc commented 2 years ago

To translate a folder, you need to invoke attranslate for each file separately. But you could write a shell-script that does those invocations in parallel for all the files that you have in a given folder.

johnfelipe commented 2 years ago

ahh ok, like with others translator, may be like REQUEST and feature create folder translator tnks

El lun, 8 ago 2022 a las 19:20, Felix K @.***>) escribió:

To translate a folder, you need to invoke attranslate for each file separately. But you could write a shell-script that does those invocations in parallel for all the files that you have in a given folder.

— Reply to this email directly, view it on GitHub https://github.com/fkirc/attranslate/issues/236#issuecomment-1208752165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFCZ523NI7R3IIL55YTVYGP3ZANCNFSM55WE3ERA . You are receiving this because you authored the thread.Message ID: @.***>

fkirc commented 1 year ago

I am closing the issue because attranslate is by design intended to be invoked multiple times from a script (one invocation for each output-file). That being said, it would be perfectly possible to write a wrapper-script around attranslate that searches through a folder and invokes attranslate multiple times.