Alexandra Nicole
Alexandra Nicole

Reputation: 87

Android Studio - Localization issues

I am building an Java-based app in Android Studio, and I am trying to do this in multiple lanuages (English and Norwegian). In the strings folder I have two files: strings.xml and strings.xml (no). This is one example of the strings I have (from Translation Editor):

enter image description here

In my activity_main.xml I am using it in a TextView like this:

<TextView
    android:layout_width="wrap_content"
    android:layout_height="68dp"
    android:gravity="center_vertical"
    android:text="@string/game_hundredquestions"
    android:textColor="@color/white"
    android:textSize="28sp"
    android:textStyle="bold"/>

I am testing it on my device here in Norway, with Norwegian language overall, but when I launch the app, it still displays it in english (100 Question), and not in Norwegian (100 Spørsmål).

What am I doing wrong? Am I missing some parts?

Upvotes: 0

Views: 86

Answers (1)

Alexandra Nicole
Alexandra Nicole

Reputation: 87

The solution:

I actually found it out by my self. In Norwegian, we have these three:

no: Norwegian

nb: Norwegian Bokmål

nn: Norwegian Nynorsk.

I simply had to create a localization file for all of them, so total 4 files: 1 in english, and 3 in norwegian.

Upvotes: 0

Related Questions