Issue
<resources>
<string name="otpValidationMessage">Please enter the One Time Password\n and validate your phone number</string>
<string name="firstName">First Name</string>
<string name="lastName">Last Name</string>
<string name="mobileNumber">Mobile Number</string>
<string name="otpPassword">One Time Password</string>
<string name="code">Code</string>
<string name="resendOTp">Resend OTP</string>
I've changed the phone language, But I don't see the language change in my app. I have all my text in the String file but still, there is no change in the app.
Solution
In onCreate do this to change your language to arabi
myLocale = new Locale("ar");//"en" if you want english
Locale.setDefault(myLocale);
android.content.res.Configuration config = new android.content.res.Configuration();
config.locale = myLocale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());
your_text_view.setText(R.string.Name);
and in strings you create as res/values-ar/strings.xml
<string name="Name">Arabi</string>
and in strings you create as res/values-en/strings.xml
<string name="Name">English</string>
If you have any doubts comment down
Answered By - g7pro
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.