Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ChaserVasya opened this issue Jul 16, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@ChaserVasya
Copy link

ChaserVasya commented Jul 16, 2024

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": {}
}
@ChaserVasya ChaserVasya added the bug Something isn't working label Jul 16, 2024
@ChaserVasya
Copy link
Author

#225

@Tienisto
Copy link
Member

Fixed in 4.0.0-dev.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants