I am developing an application which will be work in Turkish language. When I run the app in English language the app is working fine. Now when I am checking the app in Turkish language there are getting error results.
I have an array resources
<string-array name="pensionArr">// English(values-en)
<item>monthly</item>
<item>yearly</item>
</string-array>
<string-array name="pensionArr"> // Turkish(values-tr)
<item>aylık</item>
<item>yıllık</item>
</string-array>
I set this array in spinner.
adapterPension = ArrayAdapter.createFromResource(this, R.array.pensionArr, android.R.layout.simple_spinner_item);
Now I am sending the selected value from this spinner to web service. There i am comparing the value in English.
nameValuePairs.add(new BasicNameValuePair("pension_type",_pensiontype));
When I am trying to print the value _pensiontype. the value printing in console is like this
yıllık//====> yearly in English.
So the value is not comparing in the web service. So here is my question how to use English values even I choose Turkish. Is there any way for this.
Edit: Data from spinner is
_pensiontype=pensionTypeDrpgetSelectedItem().toString();
Pls Help me……
This is very tricky situation. Finally I search it in many websites and find a solution
Maintain the array in the server side as
after setting the resource array to the spinner as
Now I am sending the position of the selected item to the server as
Now I am getting the position of array at server side. so Using index instead of value directly.
works fine..