1

Please See this Image

An android application with 2 languages ENGLISH and ARABIC, there is also a registration activity which includes Password and Email . So when application is in Arabic Language I want to keep password and Email in English language. Is there any solution for it?

I Just want to make EMAIL and PAssword in ENGLISH if locale is Arabic .

Danish
  • 51
  • 12

5 Answers5

2

This concept is called Localization. To provide localization support in app, you need to create different values folders in res directory.

What you need to do is, create folder structures with having strings.xml file in each folder.

values
   strings.xml
values-ar
   strings.xml

In each strings.xml file, declare a string with same key name but put values in languages accordingly.

Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
1

I hope you have created separate string.xml file for Arabic and English

under valuse-ar create string.xml file add add this lines

<string name="email">EMAIL</string>
<string name="password">PASSWORD</string>

UPDATE

in your layout.xml

<Editext
........
.......
android:digits="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890"
......
/>

this will allow only numbers and english letters

sivaBE35
  • 1,876
  • 18
  • 23
0

Finally found the solution here: Multilingual Android app: Display English keyboard in Email & Password fields

just add android:imeOptions="flagForceAscii"

Community
  • 1
  • 1
Danish
  • 51
  • 12
0

try this tutorial

Android Building Multi-Language Supported App

enter image description here

http://www.androidhive.info/2014/07/android-building-multi-language-supported-app/

Ajay Venugopal
  • 1,544
  • 1
  • 17
  • 30
0

You can use translatable property in strings.xml

<string name="email" translatable="false">Email</string>
Lalit Jadav
  • 1,409
  • 1
  • 15
  • 38