slang-i18n / slang

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

perf: use `final` strings rather than getters #193

Closed adil192 closed 4 months ago

adil192 commented 4 months ago

This PR swaps out getters for final strings in the generated strings.g.dart file, e.g.

-   String get pages => 'Pages';
+   late final String pages = 'Pages';

Reasoning:

I'm interested to see what you think about this (whether it's necessary or will make any difference) since this is just speculation

Tienisto commented 4 months ago

Hello, slang actually had final earlier. The reason why getters are used is because hot-reloading didn't work. You can try to update the i18n file, then generate, and then the strings should be updated.