slang-i18n / slang

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

Flutter returns an error on translation key 'default' #186

Closed jaycho1214 closed 5 months ago

jaycho1214 commented 5 months ago

Describe the bug Flutter gives an error if there is a key default in a translations.

To Reproduce Steps to reproduce the behavior:

  1. strings.i18n.yaml
    empty:
    default:
    example: example
  2. Run dart run slang
  3. See error

Expected behavior Should be run without any problems

Additional context slang.yaml

fallback_strategy: base_locale
input_file_pattern: .i18n.yaml
Tienisto commented 5 months ago

Please read the error message. It clearly states that 'default' can't be used as an identifier because it's a keyword. There is nothing we can do because this is a limitation by the Dart language. Please comment if I missunderstood your problem.