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,702
  • 2
  • 22
  • 43

2 Answers2

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);
Community
  • 1
  • 1
Imran Rana
  • 11,739
  • 7
  • 44
  • 51
0

You might want to look this question. Also for urdu-pakistan you might get the code from here

Community
  • 1
  • 1
Gökhan Barış Aker
  • 4,315
  • 5
  • 23
  • 35