summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2013-04-27 16:15:03 +0530
committerChirayu Desai <cdesai@cyanogenmod.org>2013-04-27 17:37:17 +0530
commit50f2c48cce55f825e80d4369527ba4e1bd19ba74 (patch)
treed33b4f78c5896d493ded35ede0df46e38a6dd4ed /tools
parent8e456b524d6faff46ac9f202505a99dd3c43b19a (diff)
downloadframeworks_base-50f2c48cce55f825e80d4369527ba4e1bd19ba74.zip
frameworks_base-50f2c48cce55f825e80d4369527ba4e1bd19ba74.tar.gz
frameworks_base-50f2c48cce55f825e80d4369527ba4e1bd19ba74.tar.bz2
aapt: localizations: be more aggressive
* errors instead of warnings for: * A localized string for which no default-locale version exist. * A localized translation of an translateable="false" string. Change-Id: Ib700fe323019f285f5a1931fe96500b2de03106b
Diffstat (limited to 'tools')
-rw-r--r--tools/aapt/ResourceTable.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp
index 7fd429c..4f7fee3 100644
--- a/tools/aapt/ResourceTable.cpp
+++ b/tools/aapt/ResourceTable.cpp
@@ -1281,11 +1281,11 @@ status_t compileResourceFile(Bundle* bundle,
curIsFormatted = false;
// Untranslatable strings must only exist in the default [empty] locale
if (locale.size() > 0) {
- fprintf(stderr, "aapt: warning: string '%s' in %s marked untranslatable but exists"
+ fprintf(stderr, "aapt: error: string '%s' in %s marked untranslatable but exists"
" in locale '%s'\n", String8(name).string(),
bundle->getResourceSourceDirs()[0],
locale.string());
- // hasErrors = localHasErrors = true;
+ hasErrors = localHasErrors = true;
} else {
// Intentionally empty block:
//
@@ -2512,9 +2512,9 @@ ResourceTable::addLocalization(const String16& name, const String8& locale)
* Flag various sorts of localization problems. '+' indicates checks already implemented;
* '-' indicates checks that will be implemented in the future.
*
- * + A localized string for which no default-locale version exists => warning
+ * + A localized string for which no default-locale version exists => error
* + A string for which no version in an explicitly-requested locale exists => warning
- * + A localized translation of an translateable="false" string => warning
+ * + A localized translation of an translateable="false" string => error
* - A localized string not provided in every locale used by the table
*/
status_t
@@ -2531,15 +2531,15 @@ ResourceTable::validateLocalizations(void)
// Look for strings with no default localization
if (configSet.count(defaultLocale) == 0) {
- fprintf(stdout, "aapt: warning: string '%s' has no default translation in %s; found:",
+ fprintf(stderr, "aapt: error: string '%s' has no default translation in %s; found:",
String8(nameIter->first).string(), mBundle->getResourceSourceDirs()[0]);
for (set<String8>::const_iterator locales = configSet.begin();
locales != configSet.end();
locales++) {
- fprintf(stdout, " %s", (*locales).string());
+ fprintf(stderr, " %s", (*locales).string());
}
- fprintf(stdout, "\n");
- // !!! TODO: throw an error here in some circumstances
+ fprintf(stderr, "\n");
+ err = BAD_VALUE;
}
// Check that all requested localizations are present for this string