Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

String resource with "%" symbol

I am having String.xml and performing Localization.

while writing content in String tag I notice that appending text after second "%" symbol throws error.

<string name="result_unlikely">Improbable 20% to 50%</string>//working

<string name="result_unlikely">Improbable 20% to 50% required</string>//not working

any idea?

Note: I know i can write it runtime but as mentioned I am implementing Localization so using string.xml is far better

like image 440
Mohammed Azharuddin Shaikh Avatar asked Nov 30 '25 16:11

Mohammed Azharuddin Shaikh


1 Answers

Solved.

By adding formatted="false" problem resolved.

<string name="result_unlikely" formatted="false">Improbable 20% to 50% required</string>
like image 160
Mohammed Azharuddin Shaikh Avatar answered Dec 02 '25 06:12

Mohammed Azharuddin Shaikh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!