I'm currently developing an Android app which heavily uses the android resource strings for internationalization. Every string identifier name has a specific format such as
in code I can reference the string with:
and this works perfectly fine for normal strings. But as soon as I use this format for plural identifier names, I get the following error:
error: Error retrieving parent for item: No resource found that matches the given name 'example.plural.name'
The string plural definition is as follows:
and in code I reference the plural with:
// _amount is a function parameter
String exampleString = getResources().getQuantityString(R.plurals.example_plural_name_identifier, _amount, _amount);
Unfortunately the company I'm working in, really wants me to stick with this pattern. Is there any possibility to use this pattern with string plurals or do we have to rename the identifier?
How do you retrieve the plural?
int number=2; Resources res = getResources(); String quantityString = res.getQuantityString(R.plurals.example.plural.name.identifier, number, number);
Well It seems that you can use only '_' in name. Any dot int he name gives me the same problem beside dot as the first character of name.