'How to provide Arabic Language support in Android Application
I have made an application in android but now I have to provide arabic language support. I have checked many of answers in stackoverflow but from any answer I didn't get correct answer.
Solution 1:[1]
To provide localization support for different languages, we need to add the language specific resources into separate folder. For eg:Inorder to provide layouts for Arabic language
we need to create a separate folder under res folder i.e.,res/layout-ar like this.
In order to access the current language via code we can get the current language by calling
Locale.getDefault().getDisplayLanguage();
for more information look into following links: for localization :http://developer.android.com/guide/topics/resources/localization.html
for RTL layout mirroring (Arabic like languages):http://android-developers.blogspot.de/2013/03/native-rtl-support-in-android-42.html
Solution 2:[2]
Also you may need to use 'onConfigChange' to your 'AndroidManifest' file with option 'locale'
Solution 3:[3]
I am just a beginner but I have looked this question up and came up with this: http://marketplace.eclipse.org/content/android-string-localization#.VG5A_PmUeSp Eclipse provides string localization. However, when it translated the strings to Arabic, I had to double check the translation because Arabic has Feminism in Grammar and also some plural forms aren't that correct.
Solution 4:[4]
- In AndroidManifest.xml: SupportRtL this will enable alignments of images and text to right in Arabic and left in English
- Create two string resource layouts (one English, one Arabic) string Resource
- Add the same string with the same name in the two layouts but change the value of the arabic string in the (ar\strings.xml)
- Same goes to each drawable item (Also for reference I'll add how you can create a resource that ar or RL) creating arabic resourse
- Also either in the base activity to set the base local language
app = (MyApplication)getApplicationContext();lang = Actions.setLocal(this);using the function: function
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Praful Bhatnagar |
| Solution 2 | nmxprime |
| Solution 3 | Salman Mohammed |
| Solution 4 | heba rachid |
