Asthme
Asthme

Reputation: 5353

Support multiple languages at the same time?

I have seen many apps which will ask language settings when you open the app first time,it will load particular language whole time.but in my case i need to support different languages at the same time,the user can have more than 2 language songs and it should support the meta data of 4 languages(English, Korean,Japanese,Chinese) at the same time .how ever I am getting meta data from the server or local song.so I use something like that for Korean language.(in this case it won't support,Chinese)

String songnametemp = json.getString(0)//from server

String songname=`songnametemp.getBytes("iso-8859-1"), "euc-kr")`//changing to korean
TextView songtext=(TextView)findViewbyID(R.id.song);
songtext.setText(songname)

the problem is that I can't hard code for each and every language, i would not know which language(META-DATA) songs are playing from server. is there any better way to do it?

Upvotes: 1

Views: 645

Answers (3)

Vetrivel
Vetrivel

Reputation: 1149

In My lollipop device it support koreans and hindi language,but my kikat does not the support both .I think each new version they are supporting more languages. In Windows this is handled by system library called Uniscribe, on Apple systems by ATSUI, and on Linux systems by Pango. Android is based on Linux but unfortunately Google seem to have removed the parts for handling complex scripts. (A rather strange decision since most Android devices are for communications including text.) Complex scripts work fine on other mobile devices using a Linux based operating system like the Nokia N9 and N900 .in android There is no way to identify which language Unicode you song meta data has,if you the know language you can encode to specific language like what you did above. Or you can give the setting in preference"to choose language " when you launch the app first time.but however if you want support all language at the same time. You have to encode in server only ,so you can support all languages at the same time.

Upvotes: 2

Grokify
Grokify

Reputation: 16324

When I run into this issue and have control of the data stored on the server, I convert everything to Unicode, e.g. UTF-8, before storage. This way the conversion is only done once and there is no need for downstream applications to handle anything other than say UTF-8. A major benefit is your use case of displaying multiple languages together side by side which can now happen transparently.

Upvotes: 1

Ramy Sabry
Ramy Sabry

Reputation: 368

I don`t understand well what you trying to do , but for support multi-language in android for - static values , just use values like that "values-en" , "values-ar" - server values , make your web services handle language "example.com/en/getdata" "example.com/ar/getdata" and in your values add link as language

Upvotes: 0

Related Questions