ilteoood / flutter_i18n

I18n made easy, for Flutter!
MIT License
217 stars 57 forks source link

Is it possible to return different translation when param is missing? #182

Closed harkairt closed 2 years ago

harkairt commented 2 years ago

I'd like to have a welcome message. If param is specified then it should return Welcome Bob!, but if param is missing/null, it should return Welcome! (notice the ! without the space after the parameter). Right now what I can achieve is Welcome !

ilteoood commented 2 years ago

You can achieve that using 2 different translation keys and using the null check to choose what to display. Am I missing something?