mololab / json-translator

jsontt 💡 - AI JSON Translator with GPT + other FREE translation modules to translate your json/yaml files into other languages ✅ Check Readme ✌ Supports GPT / DeepL / Google / Bing / Libre / Argos
https://mololab.org/jsontt/npm
MIT License
468 stars 64 forks source link

ID TypeError: Cannot assign to read only property '10' of string #7

Closed multipliedtwice closed 2 years ago

multipliedtwice commented 2 years ago

Data to be sent:

{
    "data": {
        "name": "heuristic Ratione quaerat consectetur magnam fugiat placeat",
        "description": "<p>- Guarantee the product as in the real picture</p><p>- All products are the same as in the pictures.</p><p>- Guarantee that you won't be disappointed</p><p>- The product is made of good quality materials, meticulously sewn.</p><p>- Flexible balance with our feet.</p><p>- Products manufactured according to international standards, using grade A materials, are durable, not easily broken</p><p>- Goes with every outfit, every occasion.</p>",
        "variants": [
            {
                "id": 67,
                "price": 300,
                "unit": "1 gram",
                "stock": 999
            }
        ]
    },
    "target": "th",
    "source": "en"
}

With this dataset, the library goes into an infinite loop with the following error:

 at C:\Users\blah\strapi\node_modules\@parvineyvazov\json-translator\dist\json-translator.cjs.development.js:1340:47
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)Translation error: TypeError: Cannot assign to read only property '10' of string '{"name":"heuristic Ratione quaerat consectetur magnam fugiat placeat","description":"<p>- Guarantee the product as in the real picture</p><p>- All products are the same as in the pictures.</p><p>- Guarantee that you won't be disappointed</p><p>- The product is made of good quality materials, meticulously sewn.</p><p>- Flexible balance with our feet.</p><p>- Products manufactured according to international standards, using grade A materials, are durable, not easily broken</p><p>- Goes with every outfit, every occasion.</p>","variants":[{"id":67,"price":300,"unit":"1 gram","stock":999}]}'

How do I solve it? Thank you

multipliedtwice commented 2 years ago

Solved. Don't need to convert data that is fed to JSON. Thank you. :D