slang icon indicating copy to clipboard operation
slang copied to clipboard

Running slang apply duplicates map

Open bawahakim opened this issue 11 months ago • 1 comments

Describe the bug Running slang apply duplicates map obkects into a non-mapped version

To Reproduce Steps to reproduce the behavior:

  1. Create en-US and fr-FR files
  2. Add a map to en-US
  3. Run dart run slang analyze followed by dart run slang apply
  4. Observed behaviour below (see // fr-FR
// en-US
    "couponValidations(map)": {
      "CouponNotExist": "There is no box with this code",
      "CouponAlreadyUsed": "You have already claimed this box",
      "CouponLimitReached": "Too late! This box has no more claims available",
      "CouponExpired": "Too late! This box has expired"
    },
// fr-FR
    "couponValidations(map)": { <-- this gets added as expected
      "CouponNotExist": "There is no box with this code",
      "CouponAlreadyUsed": "You have already claimed this box",
      "CouponLimitReached": "Too late! This box has no more claims available",
      "CouponExpired": "Too late! This box has expired"
    },
    "couponValidations": { <-- This object gets added after running `slang apply`
      "CouponNotExist": "There is no box with this code",
      "CouponAlreadyUsed": "You have already claimed this box",
      "CouponLimitReached": "Too late! This box has no more claims available",
      "CouponExpired": "Too late! This box has expired"
    }

Expected behavior The object should not be duplicated

Additional context This seems to only happen with (map). Also, the duplicate does not exist in _missing_translations.json

bawahakim avatar Mar 30 '24 11:03 bawahakim