I try to learn how to program in android studio and i am currently in the second tutorial about how to change language by localizing.
When i try to create a second strings.xml
file inside the folder values_el
it say me i cant cause names should be unique.
I try to copy the original strings.xml
file from values folder to the new values_el folder, i translate the messages but nothing happens.
Also i try to right click the original strings.xml
file and i press the translate option and i translate them from there but nothing happens again.
When i run the app in my phone the language is English in both of the ways i try above.
My phone language is Greek but the letters of my program is English.
question 2.
First why the language do not change in my phone? Second is there a way to change the language of my app by pressing a button while i open it? Some games i play from google play have the option to choise your languange while before you start the game. Sorry about my english if you dont understant something i say please let me know so i try to explain it better with google translate help. Thank for your time anyway.
Thats the code i run
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_my"
android:orientation="horizontal">
<EditText
android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/edit_message" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/test"
android:onClick="testActivity" />
</LinearLayout>