slang-i18n / slang

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

Analyze does not respect linked translation in enum #231

Open ChaserVasya opened 3 months ago

ChaserVasya commented 3 months ago

To Reproduce tr_ru.i18n.json:

{
  "scheduleFailedBlockDefault": "Редактирование невозможно",
  "scheduleFieldBlockMap(context=ScheduleTemplateFieldType, param=type)": {
    "assistant": "Выберите услугу",
    "status": "Статус нельзя изменить",
    "employee": "Выберите тренера",
    "service": "Выберите локацию",
    "duration": "Выберите услугу",
    "room": "Выберите услугу",
    "capacity": "Выберите услугу",
    "date": "Выберите услугу",
    "time": "Выберите услугу",
    "visitor": "Выберите дату",
    "cancelReason,location,comment,guest,totalArrived": "@:scheduleFailedBlockDefault"
  }
}

dart run slang analyze -full _unused_translations.json:

{
  "@@info": [
    "Here are translations that exist in secondary locales but not in <ru>.",
    "[--full enabled] Furthermore, translations not used in 'lib/' according to the 'tr.<path>' pattern are written into <ru>."
  ],
  "ru": {
    "scheduleFailedBlockDefault": "Редактирование невозможно"
  }
  ....
}

Expected behavior

{
  "@@info": [
    "Here are translations that exist in secondary locales but not in <ru>.",
    "[--full enabled] Furthermore, translations not used in 'lib/' according to the 'tr.<path>' pattern are written into <ru>."
  ],
  "ru": { }
  ....
}

Additional context 3.31.1