localizely / intl_utils

Dart package that creates a binding between your translations from .arb files and your Flutter app
BSD 3-Clause "New" or "Revised" License
135 stars 81 forks source link

key has a defined format for the 'valueName' placeholder that will be ignored. #115

Open Korpyc opened 1 year ago

Korpyc commented 1 year ago

Hey, I have next string: "page_subtitle": "{rangeTitle} • {somethingCount, plural, one{1 Apple} other{{somethingCount} Apples}}", "@page_subtitle": { "placeholders": { "rangeTitle": { "type": "String", }, "somethingCount": { "type": "int", "format": "decimalPattern" } } },

so, as a result, if somethingCount >1000, I expect to see result like this: rangeTitle • 12,123 Apples

but, generator said: key has a defined format for the 'somethingCount' placeholder that will be ignored. Consider using an additional placeholder for formatting purposes.

Can we fix it without adding one more, same int value, just for formatting purposes?

lzoran commented 1 year ago

You're right. Currently, an additional placeholder is required for the formatting purpose in ICU plural messages.