slang-i18n / slang

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

Invalid class_name is set for build_runner in 3.26.0 #176

Closed lemonderon closed 10 months ago

lemonderon commented 10 months ago

Describe the bug For newest version 3.26.0: Default value of class_name parameter is "Translations" instead of "Translation" which leads to multiple linter and analyzer errors for generated file. The generated file contains a line with "typedef Translations = Translations;" which breaks the generated file.

Expected behavior Default class_name value for build_runner should not break the strings.g.dart generation.

Tienisto commented 10 months ago

This should be fixed in v3.26.1 now.

Be aware that there are currently 2 class names due to legacy reasons.

(a) strings_en.json -> StringsEn (b) via class_name config -> Translations

You might have translation.json (without s) which leads to these confusing class names. However, the internal class names shouldn't be referred (in most cases) anyways.

So there is currently no need to publish a breaking release (v4.0.0) to remove the legacy (a) version.