Skip to content

Analyze command ignores untranslated values in partially-translated enums #234

Closed
@ChaserVasya

Description

project

pubspec.yaml

  slang: ^3.31.1
  slang_flutter: ^3.31.0

data.dart

enum EmployeePermission {
  canSell,
  canBuy,
}

build.yaml

targets:
  $default:
    builders:
      slang_build_runner:
        options:
          base_locale: ru
          fallback_strategy: base_locale
          input_directory: lib/i18n
          input_file_pattern: .i18n.json
          output_directory: lib/i18n
          output_file_name: translations.g.dart
          translate_var: tr
          timestamp: false
          statistics: false
          imports:
            - package:untitled/data.dart
          contexts:
            EmployeePermission:
              generate_enum: false

tr_en.i18n.dart

{
  "employeePermissionTitleMap(context=EmployeePermission, param=perm)": {
    "canSell": "Can sell"
  }
}

tr_ru.i18n.dart

{
  "employeePermissionTitleMap(context=EmployeePermission, param=perm)": {
    "canSell": "Продавать услуги",
    "canBuy": "Покупать услуги"
  }
}

problem

dart run slang analyze result:

{
  "@@info": [
    "Here are translations that exist in <ru> but not in secondary locales.",
    "After editing this file, you can run 'dart run slang apply' to quickly apply the newly added translations."
  ],
  "en": {}
}

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions