1

Possible Duplicate:
Set Locale programatically

I am a beginner in android. making my first app, all i want to do is localize my app to urdu language/pakistan. what should i do. Where I can get the list of all android locale?

Community
  • 1
  • 1
Haris
  • 1,822
  • 2
  • 22
  • 44

1 Answers1

5

This post may be helpful, code of Urdu - Pakistan is ur-PK, which may not be present for your use. List of all android locale can be found here or here. Also take a look at localization tutorial


If you want to use urdu font for showing text in a view(say TextView) then:


Code for setting custom font to TextView:

Assuming you have a urdu ttf font say(URDU.ttf) font in fonts folder under assets folder:

 Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/URDU.ttf");               
    TextView tv = (TextView) findViewById(R.id.txtview);
    tv.setTypeface(tf);
Suraj Rao
  • 29,388
  • 11
  • 94
  • 103
Imran Rana
  • 11,899
  • 7
  • 45
  • 51