Android APP打包时,出错:"XXX" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic).....
"app_name" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan), "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "en-rGB" (English: United Kingdom), "en-rIN" (English: India), "es" (Spanish), "es-rUS" (Spanish: United States), "et-rEE" (Estonian: Estonia), "fa" (Persian), "fi" (Finnish), "fr" (French), "fr-rCA" (French: Canada), "hi" (Hindi), "hr" (Croatian), "hu" (Hungarian), "hy-rAM" (Armenian: Armenia), "in" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ka-rGE" (Georgian: Georgia), "km-rKH" (Khmer: Cambodia), "ko" (Korean), "lo-rLA" (Lao: Lao People's Democratic Republic), "lt" (Lithuanian), "lv" (Latvian), "mn-rMN" (Mongolian: Mongolia), "ms-rMY" (Malay: Malaysia), "nb" (Norwegian Bokmål), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "pt-rPT" (Portuguese: Portugal), "ro" (Romanian), "ru" (Russian), "sk" (Slovak), "sl" (Slovene), "sr" (Serbian), "sv" (Swedish), "sw" (Swahili), "th" (Thai), "tl" (Tagalog), "tr" (Turkish), "uk" (Ukrainian), "vi" (Vietnamese), "zh-rCN" (Chinese: China), "zh-rHK" (Chinese: Hong Kong), "zh-rTW" (Chinese: Taiwan, Province of China), "zu" (Zulu)
Issue: Checks for incomplete translations where not all strings are translated
Id: MissingTranslation
If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages.
If the string should not be translated, you can add the attribute translatable="false" on the <string> element, or you can define all your non-translatable strings in a resource file called donottranslate.xml. Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute.
By default this detector allows regions of a language to just provide a subset of the strings and fall back to the standard language strings. You can require all regions to provide a full translation by setting the environment variable ANDROID_LINT_COMPLETE_REGIONS.
You can tell lint (and other tools) which language is the default language in your res/values/ folder by specifying tools:locale="languageCode" for the root <resources> element in your resource file. (The tools prefix refers to the namespace declaration http://schemas.android.com/tools.)
根据错误提示的log,自己尝试 :
(1)忽略:tools:ignore="MissingTranslation" 和(2)指定文件的语言:tools:locale="zh-rCN"
结果:设置res/value/string.xml文件的 tools:ignore="MissingTranslation" 属性,可以忽略导出apk时产生的错误。
- <resources
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- tools:ignore="MissingTranslation"
- >
- <string name="app_name">XXXX</string>
- </resources>
—— - - - ——- - - —— - - - -- -—— —— —— - -—— - —— - -—— --—— - -—— ——-
—— - - - ——- - - —— - - - -- -—— —— —— - -—— - —— - -—— --—— -
以下是转载:
问题:当我们开发完成一个Android应用程序后,在发布该应用程序之前必须要经过的一步时打包应用程序。
至于从打包程序到发布的完整过程可以参考:Android 应用程序发布流程---碗豆荚发布流程
选择Eclipse ADT打包应用程序的过程如下:
可是在这时,会出现如下提示:
并且原本没有错误的程序(values/strings.xml)也会出现如下错误提示:
- "app_name" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic), "bg" (Bulgarian), "ca" (Catalan),
- "cs" (Czech), "da" (Danish), "de" (German), "el" (Greek), "en-rGB" (English: United Kingdom), "en-rIN" (English:
- India), "es" (Spanish), "es-rUS" (Spanish: United States), "et-rEE" (Estonian: Estonia), "fa" (Persian),
- "fi" (Finnish), "fr" (French), "fr-rCA" (French: Canada), "hi" (Hindi), "hr" (Croatian), "hu" (Hungarian), "hy-
- rAM" (Armenian: Armenia), "in" (Indonesian), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "ka-rGE" (Georgian:
- Georgia), "km-rKH" (Khmer: Cambodia), "ko" (Korean), "lo-rLA" (Lao: Lao People's Democratic Republic),
- "lt" (Lithuanian), "lv" (Latvian), "mn-rMN" (Mongolian: Mongolia), "ms-rMY" (Malay: Malaysia), "nb" (Norwegian
- Bokmål), "nl" (Dutch), "pl" (Polish), "pt" (Portuguese), "pt-rPT" (Portuguese: Portugal), "ro" (Romanian),
- "ru" (Russian), "sk" (Slovak), "sl" (Slovene), "sr" (Serbian), "sv" (Swedish), "sw" (Swahili), "th" (Thai),
- "tl" (Tagalog), "tr" (Turkish), "uk" (Ukrainian), "vi" (Vietnamese), "zh-rCN" (Chinese: China), "zh-rHK" (Chinese:
- Hong Kong), "zh-rTW" (Chinese: Taiwan, Province of China), "zu" (Zulu)
是什么原因呢?原因如下:
在Android SDK Tool r19之后, Export的时候遇到xxx is not translated in yyy, zzz的问题。
例如说"auto_name" is not translated in zh, zh_CN.
这是因为Android SDK Tool 將 ANDROID_LINT_COMPLETE_REGIONS 改为了需要检查。
如何解决呢?
其实,以上提示已经给我们答案。一种是“fix these before running Export ”,另一种是“turn off 'Run full error check when exporting app'”
方法如下:
先说后者:“turn off 'Run full error check when exporting app'“
(1)在Eclipse中打开Preference,按下图操作:
(2)再说前者:“fix these before running Export ”
操作如下图所示:
双击选择4,会在5的左侧出现对该问题的描述,如下:
框中也给我们三种解决方法。
即:
1》If the string should not be translated, you can add the attribute translatable="false" on the <string> element,
这种方法只适合数量较少的情况下。
2》字符串数量较大的情况,会很麻烦,这时可以采用另一种方法:
or you can define all your non-translatable strings in a resource file called donottranslate.xml.
即我们可以将所有不需要non-translatable 的字符串统一放入一个名叫donottranslate.xml的文件中。
在values新建donottranslate.xml文件,并把不需要non-translatable 的字符串放入其中.
donottranslate.xml:
- <span style="font-size:14px;"><?xml version="1.0" encoding="utf-8"?>
- <resources>
- <string name="app_name">UMengDemo</string>
- <string name="action_settings" >Settings</string>
- <string name="sharePic_text" >分享本地图片</string></span><pre name="code" class="html" style="text-indent: 0.10000000149011612px;"><span style="font-size:14px;"></resources></span>
3》Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute.
以上操作完成后,最好选择“Clean”一下项目,方法如下:
这样就可以解决以上问题了。
http://blog.csdn.net/cxc19890214/article/details/39120415
转载:http://blog.csdn.net/buaaroid/article/details/49469213
Android APP打包时,出错:"XXX" is not translated in "af" (Afrikaans), "am" (Amharic), "ar" (Arabic).....的更多相关文章
- Android Studio 打包时 Signature Version 选择V1还是V2 ?
只勾选V2会导致 7.0 以下的安卓机出现 INSTALL_PARSE_FAILED_NO_CERTIFICATES 的问题 ,推荐全选. 解决方案一v1和v2的签名使用1)只勾选v1签名并不会影响什 ...
- Android SDK安装时出错“android Failed to rename directory”的解决方法
Android SDK安装时出错"android Failed to rename directory"的解决的方法 安装Android SDK时遇到Failed to r ...
- delphi XE7 在Android编译SharedActivity时出错
delphi XE6 在Android编译SharedActivity时正常,但xe7下编译出错,在uses添加Androidapi.Helpers就可以.
- dedecms新建内容模型“把数据保存到数据库附加表时出错‘xxx’出错”错误的原因分析和解决方案(转)
把数据保存到数据库附加表 `bc_addonarticle17` 时出错,请把相关信息提交给DedeCms官方.INSERT INTO `bc_addonarticle17`(aid,typeid,r ...
- Android Studio 打包时 Signature Version 选择 V1 V2 说明
问题描述(v1和v2) Android 7.0中引入了APK Signature Scheme v2,v1是jar Signature来自JDKV1:应该是通过ZIP条目进行验证,这样APK 签署 ...
- 上传到 App Store 时出错。
Try this, it fixed it for me. Open Terminal and run: cd ~ mv .itmstransporter/ .old_itmstransporte ...
- Android APP打包错误,Could not resolve com.android.tools.lint:lint-gradle:26.1.2.
1.Please select the product flavors to build and sign 不专业的翻译一下(请选择产品的味道来制作和签名)什么鬼: 选中Flavors中的选项即可: ...
- 将本地jar包手动复制到Maven库中,在其它电脑上用Maven打包时出错
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/UP19910522/article/details/31396107 背景交代:在做图片水印时候引入 ...
- 使用Jenkins进行Android自动打包,自定义版本号等信息【转】
之前App在提交测试和最终部署的过程中App打包一直是由开发人员来完成的,由于项目比较大, 再加上Android打包本身就比较慢,所以每次打包还是很耗时的.并且按照严格的研发流程来讲,开发人员应该只负 ...
随机推荐
- Python数据分析-Pandas(Series与DataFrame)
Pandas介绍: pandas是一个强大的Python数据分析的工具包,是基于NumPy构建的. Pandas的主要功能: 1)具备对其功能的数据结构DataFrame.Series 2)集成时间序 ...
- 重复造轮子系列--内存池(C语言)
这个代码是我上个公司工作项目的里面内存管理(基于伙伴算法)的一个简化又简化的版本. 因为没有内存边界检查: 因为没有内存使用统计: 因为没有考虑线程安全: 因为没有内存分配操作的具体文件位置信息: 因 ...
- JavaScript中的parseInt和Number函数
函数作用: parseInt将字符串(String)类型转为整数类型. Number() 函数把对象(Object)的值转换为数字. 语法不同: parseInt(string, [radix]) s ...
- 类复制 MemberwiseClone与Clone(深 浅 Clone)
MemberwiseClone 方法创建一个浅表副本,具体来说就是创建一个新对象,然后将当前对象的非静态字段复制到该新对象.如果字段是值类型的,则对该字段执行逐位复制.如果字段是引用类型,则复制引用但 ...
- webpack最佳入门实践系列(4)
7.使用字体 7.1.安装字体库-font-awesome 我们通过npm来安装字体 npm install font-awesome --save 这个时候,我们的package.json配置文件变 ...
- 【CF1017F】The Neutral Zone(Bitset,埃氏筛)
题意: 思路:From https://blog.csdn.net/CSDNjiangshan/article/details/81536536 #include<cstdio> #inc ...
- IOS-使用CAShapLayer绘制扇形
IOS-使用CAShapLayer绘制扇形 为了增加应用体验感,我们动态绘制扇形或者饼状图效果. 这里我们使用CAShapeLayer,这样就不必再-(void)draw函数内绘制图形 参考代码 -( ...
- 关于try-catch-finally return 的面试题
public class Test { public static void main(String[] args) { System.out.println(test()); } static in ...
- jQuery遍历文档(重要)
什么是遍历? jQuery 遍历,意为"移动",用于根据其相对于其他元素的关系来"查找"(或选取)HTML 元素.以某项选择开始,并沿着这个选择移动,直到抵达您 ...
- ssh xshell 连接在vim中无法用 ctrl+insert 复制黏贴
在用户目录编辑.vimrc文件不存在则创建,vi的三种模式:命令模式,插入模式,可视模式,鼠标可以启动于各种模式中,所以配置文件中的set mouse=a启动了所有模式,这样就屏蔽了鼠标右健功能,se ...