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

Support placeholders when extracting strings with ${string.concatenation} #120

Open percula opened 2 months ago

percula commented 2 months ago

For strings in dart code that use string concatenation (for example: "The house is ${house.color}"), it would be very useful if the plugin recognized this placeholder value when extracting the string to the .arb file.

In this example, it would replace the string with: S.of(context).myStringKey(house.color)

Bonus points if it adds a placeholder in the arb file, to be filled in later (or via the dialog):

"myStringKey": "The house is {houseColor}",
"@myStringKey": {
  "placeholders": {
    "houseColor": {
      "type": "String",
      "example": ""
    }
  }
}