slang-i18n / slang

Type-safe i18n for Dart and Flutter
https://pub.dev/packages/slang
MIT License
459 stars 39 forks source link

[Analyze] RichText json key re-appreared regardless translated in all locales in _missing_translations_...json file #199

Closed honghai2196 closed 6 months ago

honghai2196 commented 6 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Prequisite: 2 locales: en_US.json and vi_VN.json
  2. Add a richtext key translation in en_US.json: "test_feature(rich)": "Test feature {name}"
  3. Add a richtext key translation in vi_VN.json: "test_feature(rich)": "Tính năng thử nghiệm {name}"
  4. Run missing analyze command: dart run slang analyze --split-missing
  5. The key test_feature(rich): "Test feature {name}" is still appeared in file _missing_translations_vi_VN.json

Expected behavior The key test_feature(rich): "Test feature {name}" is disappeared.

Actual behavior

Screenshot 2024-03-14 at 3 39 57 PM

Additional context Add any other context about the problem here.

bawahakim commented 6 months ago

What's the reason this was closed? I have a similar problem, where keys with modifiers are duplicated after running dart run slang apply.

E.g.

// en
    "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
    "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"
    },
    "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"
    }