slang-i18n / slang

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

Add Documentation comments to the generated translation file #218

Open fa0311 opened 2 months ago

fa0311 commented 2 months ago

Motivation

I migrated from gen_l10n to slang, and the generated documentation is better in gen_l10n than in slang. Since I am a native Japanese speaker, I need to be able to quickly preview member variables in Japanese, not just their names.

gen_l10n generates the following.

  /// No description provided for @title.
  ///
  /// In en, this message translates to:
  /// **'Title'**
  ///
  /// In ja, this message translates to:
  /// **'タイトル'**
  String get title;

image

slang generates the following.

    String get title => 'title';

image

Tienisto commented 2 months ago

I don't know if this is scalable if you have many locales. The generated file would be very big.

aitaro commented 3 weeks ago

How about limiting this to only the base_locale? This functionality is useful to understand if the rendering is appropriate just by looking at the code.

Tienisto commented 3 weeks ago

I always jump to the declaration when I want to see the base translation (which is ctrl+left click). Don't know if the benefit is great enough to sacrifice the bigger file size