I want to support the greek language.
I translated my string.xml into the greek language.
Then I put the greek string.xml it into a folder called: res/values-gr besides the normal res/values.
So my folder looks like this: res/values-gr/string.xml
Then I set my phone language to greek.
However, the app still displays english only.
Has anybody an idea what I am doing wrong?
In your case you need to create a folder:
values-el for the Greek translation, or
values-el-rGR for the country-specific Greek translation.
Related
Using Multi language(Arabic,English) in Application.
If we set Arabic language as language in the app.For Numbers,Text view showing Arabic number.I want English numbers not Arabic number even if we selected English language.how to show number in English even if language is in Arabic?
Ok
Just Try to put Your string and Numbers In formatted String and use this
something like this
<string name="welcome_messages">Hello, %1$s! You have %2$d new messages.</string>
and then
<resources xmlns:tools="schemas.android.com/tools"; tools:locale="en">
By default numbers are displayed in English only, unless you format the string, but it is not a good practice to use digits in English while using language that supports RTL specification. Please refer this: https://developer.android.com/training/basics/supporting-devices/languages.html#FormatNumbers
It seems that you are changing language from device setting, please try changing language within the app, changing language from device setting will display numbers in that language.
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
I have two projects
Project1 contains a strings file with entry (values, values-ar) for Arabic and English accordingly.
Project2 which include Project1 and must override the entry of strings file with Arabic text in both (values, values-ar)
When I put its value in arabic it doesn't show my text, but when I add English text it works
I have tried it many times and I don't know what the problem is, can anyone help please.
Android chooses the right string file according to device's language.
Placing the Arabic Strings on files at rec/values-ar/ folder and setting device's language to "ar" will work.
If project 2 is exclusively Arabic remove the values-ar and place all your Arabic text within the values folder.
Ensure that every string value in Project1's values is placed within Project2's values file in Arabic to override all English values.
You can use strings in this way: " R.string.*" or in xml: "android:text=#strings/*" - right?
They all take their values out of a fixed file named strings where you put them all in right?
Let's say I have an app where there is the possibility to change language. Is there a way in which I can change that string file? Let's say have a strings file for English and strings for French or anything.. so i can still use the R.string.* and #string/* but I will get different values depends on the user choice?
The Developer's Guide on Localization covers this.
In short use the same string names, but have different locale folders, like:
res/values/strings.xml for the default language
res/values-fr/strings.xml for French
res/values-ja/strings.xml for Japanese
The OS will load the appropriate language for R.string.hello for you.