Im trying to build aosp for my devkit, and i'd like to know where
should i look to for :
to changing font size of texts
in settings section ( i've replaced
droid fonts with another one but the
new font kind large) or global font
setting.
to change position of texts in
settings section ( usually all texts
are
in left side, i want to try and put it in right side for example).
the language locale names that
showed in settings/language &
keyboards.. where are they stored .
i looked into LocalePicker.java but
could not figure it out.
For example i want to change a locale name from english to it's native
language (In some android builds i've seen arabic locale was in english, and
some other builds it was shown in native arabic العربية).
Related
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.
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
Also you may need to use 'onConfigChange' to your 'AndroidManifest' file with option 'locale'
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.
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
can I change the referring a resource folders programmaticaly. I need to use a language that is not supported by android, in my case Sinhala. can I create a values_sin folder and refer it when user select Sinhala language. can I change the font together with that for entire application.
How about this: put your Sinhala strings in res/values/strings.xml, and the English strings in res/values-en/strings.xml or maybe even better, in res/values-en-rIN/strings.xml. When using the second method, your app will be in English only if the user selects "English (India)" as the phone's language. In any other case, the default resources will be used - which in your case will be in Sinhala!
Edit 2: actually, Android does support Sinhalese, using res/values-si. If you can't select Sinhalese as your device's default language, you could change it at runtime. There are plenty of posts already, such as Changing Locale within the app itself
In my app,i have used 'locale' to change language hindi in programatically.and i also used .ttf file to convert title of app sub page in hindi language.but when i change language ,the other control change language automatically..for ex,datepicker etc,
when i have to set value in textview directly,its value can't be converted in hindi .but when i have some changes regarding that value and after set value in textview,then it will convert hindi language automaetically.please give me some solution of this.
Thank you.
I can tell you from my own experiences that it will result in strange behaviour when changing the language "manually". It is not recommended. Sometimes even changing the device orientation will overwrite your changes due to the changed configuration. Just be aware that this approach is not supported or intended by Android.
I am working on an application that will work on Android WebView. I enabled the selection and copy for this view. In some devices that support Arabic, When I paste the copied text from WebView in any EditText view, It shows me the reserve text. but In some cases it shows me the correct form.
Could any one please help me to show in correct form in all devices ? :-/
I have red all threads that depend on supporting Arabic and Farsi Text, but I can not reach my purpose.
Thanks in advance :)
You can pass your copied text to FarsiLibrary. It will analyses your text letters and justify them according to their possible 4 states (Initial, Middle, End, Isolated) :
Initial like 'ن' in 'نازک'
Middle like 'ن' in 'هنر'
End like 'ن' in 'وطن'
Isolated like 'ن' in 'ایران'
Android has Added support for RTL in Native widgets(i.e TextView , EditText) . so if u run the app onward 4.2 u will get RTL feature automatically ,
http://android-developers.blogspot.com.es/2013/03/native-rtl-support-in-android-42.html
You can create different versions of the layouts for different API versions.
As you can read here: http://developer.android.com/guide/topics/resources/providing-resources.html you can have say the normal folder (/res/layout/) with the layout for old devices and then another one for the ones that support it: /res/layout-11/
The layout inside layout-v11 will only be applied on devices with android 3.0 and over.
Am doing a danish project, so when i long press in the edit text box i need the "Edit", "copy", "paste" etc commands in danish. In my phone there is no danish language can be selected.
any help is appreciated.
thanks in advance....
jibysthomas
I think you have to use Typeface for using Danish language without selecting Danish language from your phone language.
And for long press dialog I think you have to make your custom dialog and use that. I am not sure but this is my idea.
Thanks.
I use "Scandinavian keyboard " and when i need it press and hold the input box and change the "input method" to this keyboard
https://play.google.com/store/apps/details?id=com.android.inputmethod.norwegian&hl=es
hope it works 4 you
Your Android build must support each localization for the system menus to appear in the desired language. Yes it is possible to support a language by overriding the system menus but if you use Danish as your default language in the app and the system language is set to Danish the system menus will appear in Danish.
Download a custom locale app from the market and use it to change your phone locale to Danish. In your app, you then need to support localization. Read this document on localization. It helped me a lot when I was localizing an app. Briefly, you will need to create a "values-da" folder under res, create strings.xml and define the strings you need with your Danish values. Don't forget that you need to have a strings.xml file in your regular "values" folder as well with all the strings defined. This folder represents the default string values, and is useful to fall back on if a string is not found in your "values-da" folder.
Trust me, the whole process is actually a lot easier than it sounds.