localizely / flutter-intl-intellij

This Android Studio & IntelliJ plugin generates boilerplate code for localization of Flutter apps with official Dart Intl library
MIT License
129 stars 4 forks source link

Suppress warning for keys that lacks translation for the plural form. #98

Closed iLoveDocs closed 1 year ago

iLoveDocs commented 1 year ago

I have this key in intl_en.arb file.

{
  "fooBar": "{days, plural, =0{} =1{1 day} other{{days} days}}",
  "@fooBar": {
    "placeholders": {
      "days": {
        "type": "num"
      }
    }
  }
}

I always get this warning

WARNING: The 'fooBar' key lacks translation for the plural form '=0'.

I intentionally left the String blank in 0{} and I want to suppress this warning, is there any way to do that? I don't want to add an empty space like 0{ } otherwise, I'll have to trim things in Dart code.

lzoran commented 1 year ago

Thanks for bringing this up.

At the moment, all empty plural/select forms trigger a warning. I perceive this as a beneficial alert to spot any unintentional omission of translations.

May I inquire as to why you'd prefer to retain the =0 plural form even when it's not utilized?