My app supports both English and Arabic language. So, I placed strings in strings.xml files for both language separately. I need a formatted string, for that I used the format specifiers in the strings.xml file(see below string). I can place the format specifier correctly in the English language file but unable to place the format specifier correctly in the Arabic language file.
<string name="device_offline_message" formatted="false">%s is offline. Please make sure it is online to execute the action.</string>
In Arabic, I can't place the string at the end of the string. Even if I specify the formatter in the start of the text, the lint
check shows an error in the java code like
Format string 'device_offline_message' is not a valid format string so it should not be passed to String.format
in the below line of code where I used the string
showToastAlertDialog(String.format(getString(R.string.device_offline_message), device.getShortName()));