Android的,语言文件不起作用 [英] Android, Language files not work

查看:205
本文介绍了Android的,语言文件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在建立一个Android应用程序,并尝试添加语言文件我的母语。
但在某种程度上这不是为我工作,先后尝试加载应用程序在两个不同的手机相同的结果。以前创建良好的结果,但不是这一次语言文件。 (电话设置为其他应用程序已经我创造的瑞典和语言文件的工作。)

I'm creating a android app now and try to add language file for my native language. But in some way this not work for me, has try to load the app in two different phone with same result. Has before create language file with good result but not this time. (The phone is set to Swedish and the language file work for other apps I has create.)

在项目中,我有

res
   values
      strings.xml
      style.xml
   values-se
      strings.xml
   [more not values folder]

目标语言是瑞典语(SE),但我找不到出路,这不是在这个应用程序为我工作。

The target language is Swedish (se), but I can't find out way this not work in this app for me.

值/ strings.xml档案

The values/strings.xml file

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">My Quick Notes</string>
    <string name="delete_item">Delete this note?</string>
    <string name="add_item">Add new note</string>
    <string name="switch_note_mode">Switches notes mode</string>
    <string name="text_about">About</string>
    <string name="text_help">Help</string>
    <string name="text_ok">Ok</string>
    <string name="text_switch_mode">Switch Mode</string>
    <string name="text_about_message" formatted="false">Created by Figaro\nA simple notepad app.\nCopyright © 2012\nfigaro@evigfilosofi.se</string>
    <string name="text_help_message">A simple notepad app for make quick notes.\n
        \nClick on the first note with the green plus chars for add a new note.\n
        \nMy Quick Notes support mulit list mode as normal mode, bullet list and checkbox list.
        \nThe checkbox mode can be use for create a check list and check off list. Click on the checkbox for toggle the checkbox.
    </string>
</resources>

和值-SE / strings.xml中

And values-se/strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">My Quick Notes</string>
    <string name="delete_item">Radera anteckning</string>
    <string name="add_item">Ny anteckning</string>
    <string name="switch_note_mode">Växa anteckningsläge</string>
    <string name="text_about">Om</string>
    <string name="text_help">Hjälp</string>
    <string name="text_ok">Ok</string>
    <string name="text_switch_mode">Växla Läge</string>
    <string name="text_about_message" formatted="false">Skapad av Figaro\nEn enkel antecknings app\nCopyright © 2012\nfigaro@evigfilosofi.se</string>
    <string name="text_help_message" formatted="false">En enkel notepad för att snabbt göra anteckningar\n
        \nKlicka på den första noten med grönt plustecken för att skapa en ny anteckning.\n
        \nMy Quick Notes stöder flera list lägen så som normalt läge, punktlista och checkboxlista\n
        \nCheckbox läge kan användas för att skapa checklistor som kan prickas av. Klicka på checkrutan för att ändra den.
    </string>
</resources>

这两个文件的类型是UTF-8(记事本++说了吧),
我也试图与瑞典语言文件这项工作,以取代英国副本,
而我所看到的,系统只选择默认的语言文件和自定义文件?

Both files is of type utf-8 (notepad++ say it), I has also try to replace the English copy with the Swedish language file and this work, and what I can see, the system only select the default language file and the custom files?

有人说知道这种方式不适合我?

Somebody that know way this not work for me?

推荐答案

您正在使用的瑞典顶级域名的缩写,这是不是你应该在这种情况下使用什么。

You're using the Sweden top level domain name abbreviation, which is not what you're supposed to use in this case.

href=\"http://www.wilsonmar.com/android_localization.htm\" rel=\"nofollow\"> Android的本地化 code瑞典来自瑞典的价值观sv_rSE

The Android localization code for Swedish from Sweden is values-sv_rSE

SV 是实际code为在语言瑞典

sv is the actual code for the language Swedish

这篇关于Android的,语言文件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆