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
494 stars 71 forks source link

Bug: Array Duplication in Repeated Translations #79

Open fadkeabhi opened 1 month ago

fadkeabhi commented 1 month ago

Description

When translating a file containing an array structure multiple times, the array size increases in the translated output file instead of maintaining the original structure or skipping already translated elements.

Steps to Reproduce

  1. Create an input file with an array structure
  2. Perform initial translation
  3. Run translation again on the same file

Current Behavior

The array elements are duplicated in the output file with each subsequent translation, leading to unwanted array growth.

Related Information

Related to PR #68 (feat: skip already translated keys) I found and fixed this array duplication issue. I'll be submitting a PR with this fix shortly.