Issue
I am making an android app just to try out using string resources to automatically change the text to the Norwegian language. This by saving the default english texts strings in a strings.xml file, and the norwegian translation in a different strings.xml file in a different values-folder. The emulator is set to the Norwegian language. In theory the app should display Norwegian text. Unfortunately when I run the app, only the default english text shows. What is wrong here? Why does the text still appear in english?
First the translated norwegian strings.xml file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TesterActivityForLoop</string>
<string name="txtView1">Trykk knapp nr. \"1\" tre ganger</string>
<string name="txtView2_1">Bra, du trykte rett knapp</string>
<string name="txtView2_2">Gal knapp</string>
<string name="txtView2_3">"Gal knapp"</string>
<string name="action_settings">Instillinger</string>
</resources>
Then the default english strings.xml-file:
<resources>
<string name="app_name">TesterActivityForLoop</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="txtView1">Push button \"1\" three times</string>
<string name="txtView2_1">Good, you pushed the right button</string>
<string name="txtView2_2">Wrong button</string>
<string name="txtView2_3">"Wrong button "</string>
</resources>
Then an overview of the project:
Solution
Change values-no
to values-nb_NO
. That's Norway's correct Android locale.
Answered By - Mohammed Aouf Zouag
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.