I'm providing Arabic support for the already-completed app. On changing the app language to Arabic, numbers are displaying with Arabic digits for the XML strings.
But my problem is on executing the following code
getString(R.string.value, ++value);
values
<string name="value">Value : %d</string>
values-ar
<string name="value">%d :القيمة </string>
with English, it is working fine.
Value: 1
On changing the language to Arabic (Appearing in Arabic). It must be in English (0-9)
Value : (Number in Arabic)
Please provide a solution to my problem.
You can change the locale of the number using String.format to always be shown in English:
String.format(Locale.ENGLISH, getString(R.string.value), ++value)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With