Android 错误:“app_name”未在 af 中翻译
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21118725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error: "app_name" is not translated in af
提问by alexcha
I am new at Android coding and this forum. When I am trying to run the project to test it I am getting the following error:-
我是 Android 编码和这个论坛的新手。当我尝试运行该项目进行测试时,出现以下错误:-
"app_name" is not translated in af, am, ar, be, bg, ca, cs, da, de, el, en-rGB, en-rIN, es, es-rUS, et, et-rEE, fa, fi, fr, fr-rCA, hi, hr, hu, hy-rAM, in, it, iw, ja, ka-rGE, km-rKH, ko, lo-rLA, lt, lv, mn-rMN, ms, ms-rMY, nb, nl, pl, pt, pt-rBR, pt-rPT, ro, ru, sk, sl, sr, sv, sw, th, tl, tr, uk, vi, zh-rCN, zh-rHK, zh-rTW, zu
“app_name”未翻译成 af、am、ar、be、bg、ca、cs、da、de、el、en-rGB、en-rIN、es、es-rUS、et、et-rEE、fa、fi , fr, fr-rCA, hi, hr, hu, hy-ram, in, it, iw, ja, ka-rGE, km-rKH, ko, lo-rLA, lt, lv, mn-rMN, ms, ms -rMY、nb、nl、pl、pt、pt-rBR、pt-rPT、ro、ru、sk、sl、sr、sv、sw、th、tl、tr、uk、vi、zh-rCN、zh-rHK , zh-rTW, zu
in values/strings.xml
在 values/strings.xml
strings.xml:-
字符串.xml:-
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">ThessMuseams</string> <string name="hello_world">Hello world!</string> <string name="menu_settings">Settings</string>
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">ThessMuseams</string> <string name="hello_world">Hello world!</string> <string name="menu_settings">Settings</string>
回答by Amit Anand
In your ADT
go to window->Preferences->Android->Lint Error Checking
在你ADT
去window->Preferences->Android->Lint Error Checking
Find there MissingTranslation
and change its Severity
to Warning
.
找到那里MissingTranslation
并将其更改Severity
为Warning
.
回答by grebulon
With Android Studio, you can prevent lint from checking the MissingTranslation warning. Add the following to your app/build.gradle:
使用 Android Studio,您可以防止 lint 检查 MissingTranslation 警告。将以下内容添加到您的 app/build.gradle:
To ignore this in a gradle build add this to the android section of your build file:
要在 gradle 构建中忽略这一点,请将其添加到构建文件的 android 部分:
android {
...
lintOptions {
disable 'MissingTranslation'
}
...
}
回答by Kris Roofe
For Android Studioyou can use either of the below ways to solve this issue
对于Android Studio,您可以使用以下任一方法来解决此问题
Method 1. Disable MissingTranslation check in build.gradle with
方法 1. 在 build.gradle 中禁用 MissingTranslation 检查
android {
lintOptions {
disable 'MissingTranslation'
}
}
Method 2. Ignore the MissingTranslation in you resource strings file with
方法 2. 忽略资源字符串文件中的 MissingTranslation
<?xml version="1.0" encoding="utf-8"?>
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation" >
<!-- your strings here; no need now for the translatable attribute -->
</resources>
Method 3. Set translatable to false on specific string with
方法 3. 在特定字符串上将 translatable 设置为 false
<string name="hello" translatable="false">hello</string>
You also can refer to Avoid Android Lint complains about not-translated string
回答by Oubaida AlQuraan
You should disable the : "Run full error check when exporting app and abort if fatal errors are found".
您应该禁用:“导出应用程序时运行完整错误检查并在发现致命错误时中止”。
you can disable it from option in :
您可以从以下选项中禁用它:
"Window" > "Preferences" > "Android" > "Lint Error Checking"
“窗口”>“首选项”>“Android”>“Lint 错误检查”
You should be able to disable
你应该能够禁用
"Run full error check when exporting app and abort if fatal errors are found".
“导出应用程序时运行完整的错误检查,如果发现致命错误则中止”。
回答by sfledthered
Try adding translatable="[true/false]".
尝试添加 translatable="[true/false]"。
<string name="app_name" translatable="false">ThessMuseams</string>
回答by KAUSHAL J. SATHWARA
How to disable Translations error messages
如何禁用翻译错误消息
If you want to suppress the error message then go to,
如果您想抑制错误消息,请转到,
On Mac OS X,
在 Mac OS X 上,
Eclipse -> Preferences -> Android -> Lint Error Checking
Eclipse -> 首选项 -> Android -> Lint 错误检查
Solving Eclipse Android Lint Translation error messages
解决 Eclipse Android Lint Translation 错误消息
On Windows,
在 Windows 上,
Window -> Preferences -> Android -> Lint Error Checking
窗口 -> 首选项 -> Android -> Lint 错误检查
回答by Riadhovic
The error is thrown by a check called lint which checks every dependency and guesses you want your app to be translated into all language the libraries you use are translated, in case of maps basically everyone. There is some setting for lint in the Eclipse preferences(Missing Translation). You could completely turn lint off or configure it so it ignores the translation warnings.
该错误是由名为 lint 的检查引发的,该检查会检查每个依赖项并猜测您希望将您的应用程序翻译成您使用的库被翻译的所有语言,在地图的情况下基本上是每个人。Eclipse 首选项(缺少翻译)中有一些 lint 设置。您可以完全关闭 lint 或对其进行配置,使其忽略翻译警告。
回答by ralphgabb
Just click the Checkbox dropdown icon near AVD Manager . Then Select Clear Lint Warnings. That will fix it.
只需单击 AVD Manager 附近的复选框下拉图标。然后选择清除棉绒警告。那将修复它。
回答by Unknown.geeko
On Windows,
在 Windows 上,
Window -> Preferences -> Android -> Lint Error Checking Preferences Window
窗口 -> 首选项 -> Android -> 检查首选项窗口的Lint 错误
Run full error check must be unchecked
必须取消选中运行完整错误检查
回答by Fuat
You can write translation of the text to "Translations editor".
您可以将文本的翻译写入“翻译编辑器”。