leolabs / json-autotranslate

Translate a folder of JSON files containing translations into multiple languages.
MIT License
139 stars 43 forks source link

issue with type of json with azure #70

Open johnfelipe opened 2 years ago

johnfelipe commented 2 years ago

messages.zip helper-messages.zip

Found 1 target language(s):
-> es

🏭 Loading source files...
β”œβ”€β”€ helper-messages.json (key-based)
β”œβ”€β”€ messages.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

πŸ’¬ Translating strings from en to es...
β”œβ”€β”€ Translating helper-messages.json (+84)
β”œβ”€β”€ Translating messages.json
An error has occurred:
input.match is not a function
TypeError: input.match is not a function
    at exports.matchI18Next (/root/json-autotranslate/node_modules/json-autotranslate/lib/matchers/i18next.js:5:25)
    at Object.exports.replaceInterpolations (/root/json-autotranslate/node_modules/json-autotranslate/lib/matchers/index.js:20:24)
    at /root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:107:49
    at Array.map (<anonymous>)
    at AzureTranslator.<anonymous> (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:105:45)
    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 /root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:4:12)
johnfelipe commented 2 years ago

@leolabs r u there?

johnfelipe commented 2 years ago

SNAG-1242

leolabs commented 2 years ago

I think it has to do with the translation in line 968 in your file. This tool expects translations to be a string instead of a number. Maybe I can add a filter to skip all non-string entries in the input files.

johnfelipe commented 2 years ago

That would be great

El vie, 10 de jun. de 2022, 9:57 a. m., Leo Bernard < @.***> escribiΓ³:

I think it has to do with the translation in line 968 in your file. This tool expects translations to be a string instead of a number. Maybe I can add a filter to skip all non-string entries in the input files.

β€” Reply to this email directly, view it on GitHub https://github.com/leolabs/json-autotranslate/issues/70#issuecomment-1152451713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFC666ZIPLJMYW7QHWLVONJVBANCNFSM5YEGK7MA . You are receiving this because you authored the thread.Message ID: @.***>

johnfelipe commented 2 years ago

Instructions for pull pls

El vie, 10 de jun. de 2022, 10:47 a. m., john felipe urrego mejia < @.***> escribiΓ³:

That would be great

El vie, 10 de jun. de 2022, 9:57 a. m., Leo Bernard < @.***> escribiΓ³:

I think it has to do with the translation in line 968 in your file. This tool expects translations to be a string instead of a number. Maybe I can add a filter to skip all non-string entries in the input files.

β€” Reply to this email directly, view it on GitHub https://github.com/leolabs/json-autotranslate/issues/70#issuecomment-1152451713, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFC666ZIPLJMYW7QHWLVONJVBANCNFSM5YEGK7MA . You are receiving this because you authored the thread.Message ID: @.***>

johnfelipe commented 2 years ago

i delete repo and clone again and error persist

An error has occurred:
input.match is not a function
TypeError: input.match is not a function
    at exports.matchI18Next (/root/json-autotranslate/node_modules/json-autotranslate/lib/matchers/i18next.js:5:25)
    at Object.exports.replaceInterpolations (/root/json-autotranslate/node_modules/json-autotranslate/lib/matchers/index.js:20:24)
    at /root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:107:49
    at Array.map (<anonymous>)
    at AzureTranslator.<anonymous> (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:105:45)
    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 /root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:4:12)
johnfelipe commented 2 years ago

I think it has to do with the translation in line 968 in your file. This tool expects translations to be a string instead of a number. Maybe I can add a filter to skip all non-string entries in the input files.

remember im using Azure not DeepL

leolabs commented 2 years ago

Ah, the update I pushed was not related to this issue. I think I can take a deeper look at it on Sunday.

johnfelipe commented 2 years ago

dear may be i can help you, show me how update and wil send you PR, i need this ASAP for academic job, pls

johnfelipe commented 2 years ago

Ah, the update I pushed was not related to this issue. I think I can take a deeper look at it on Sunday.

Hi dear can u help me for azure?

johnfelipe commented 2 years ago

Help pls with azure engine

johnfelipe commented 2 years ago

sorry for persistent. pls help me for solve that json formats and with azure engine

johnfelipe commented 2 years ago

Hi dear, busy? Pls help me about Json file missed ...

johnfelipe commented 2 years ago

hi dear, i pull latest version and json format is actual bad translation

messages.zip

πŸ—‚ Created the cache directory.
Found 1 target language(s):
-> es

🏭 Loading source files...
β”œβ”€β”€ messages.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

πŸ’¬ Translating strings from en to es...
β”œβ”€β”€ Translating messages.json
An error has occurred:
input.match is not a function
TypeError: input.match is not a function
    at exports.matchI18Next (/root/json-autotranslate/node_modules/json-autotranslate/lib/matchers/i18next.js:5:25)
    at exports.replaceInterpolations (/root/json-autotranslate/node_modules/json-autotranslate/lib/matchers/index.js:20:24)
    at /root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:107:49
    at Array.map (<anonymous>)
    at AzureTranslator.<anonymous> (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:105:45)
    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 /root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/root/json-autotranslate/node_modules/json-autotranslate/lib/services/azure-translator.js:4:12)
johnfelipe commented 2 years ago

anyone?

johnfelipe commented 2 years ago

Dear pls update asap

johnfelipe commented 2 years ago

Ah, the update I pushed was not related to this issue. I think I can take a deeper look at it on Sunday.

hi dear, any progress?

leolabs commented 2 years ago

Hey @johnfelipe,

Unfortunately I haven't found the time to work on this yet. I can't promise a timeframe since the project is just a side project and my weeks are quite full at the moment, but I'll let you know when a new release is available.

johnfelipe commented 2 years ago

Dear can u update for azure, pls

El vie, 10 de jun. de 2022, 5:26 p. m., Leo Bernard < @.***> escribiΓ³:

Ah, the update I pushed was not related to this issue. I think I can take a deeper look at it on Sunday.

β€” Reply to this email directly, view it on GitHub https://github.com/leolabs/json-autotranslate/issues/70#issuecomment-1152777611, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFBUBFLIKLDMDOGE473VOO6GNANCNFSM5YEGK7MA . You are receiving this because you authored the thread.Message ID: @.***>