]> git.saurik.com Git - android/aapt.git/commitdiff
Make it an error to use a bare apostrophe in aapt, and adjust warnings/errors.
authorEric Fischer <enf@google.com>
Tue, 1 Sep 2009 22:20:30 +0000 (15:20 -0700)
committerEric Fischer <enf@google.com>
Tue, 1 Sep 2009 22:20:30 +0000 (15:20 -0700)
In practice, no one ever writes an apostrophe in an aapt string with the
intent of using it to quote whitespace -- they always mean to include a
literal apostrophe in the string and then are surprised when they find
the apostrophe missing.  Make this an error so that it is discovered
right away instead of waiting until late in QA or after the strings have
already been sent for translation.  (And fix a recently-introduced string
that has exactly this problem.)

Silence the warning about an empty span in a string, since this seems to
annoy people instead of finding any real problems.

Make the error about having a translated string with no base string into
a warning, since this is a big pain when making changes to an application
that has already had some translations done, and the dead translations
should be removed by a later translation import anyway.

ResourceTable.cpp
XMLNode.cpp

index 95a238401832e78941f045652788cc9950378c80..f9d243423dca99433b4a74f2603d948236014562 100644 (file)
@@ -2364,13 +2364,12 @@ ResourceTable::validateLocalizations(void)
                         String8 region(config.string(), 2);
                         if (configSet.find(region) == configSet.end()) {
                             if (configSet.count(defaultLocale) == 0) {
                         String8 region(config.string(), 2);
                         if (configSet.find(region) == configSet.end()) {
                             if (configSet.count(defaultLocale) == 0) {
-                                fprintf(stdout, "aapt: error: "
+                                fprintf(stdout, "aapt: warning: "
                                         "*** string '%s' has no default or required localization "
                                         "for '%s' in %s\n",
                                         String8(nameIter->first).string(),
                                         config.string(),
                                         mBundle->getResourceSourceDirs()[0]);
                                         "*** string '%s' has no default or required localization "
                                         "for '%s' in %s\n",
                                         String8(nameIter->first).string(),
                                         config.string(),
                                         mBundle->getResourceSourceDirs()[0]);
-                                err = UNKNOWN_ERROR;
                             }
                         }
                     }
                             }
                         }
                     }
index 6daa0d206da62065111102bf20c68b21d4fb6b17..d4d2a45c2d0f592e1c4ee741575d8dd67a2b673d 100644 (file)
@@ -219,7 +219,12 @@ moveon:
             }
             spanStack.pop();
 
             }
             spanStack.pop();
 
-            if (empty) {
+            /*
+             * This warning seems to be just an irritation to most people,
+             * since it is typically introduced by translators who then never
+             * see the warning.
+             */
+            if (0 && empty) {
                 fprintf(stderr, "%s:%d: warning: empty '%s' span found in text '%s'\n",
                         fileName, inXml->getLineNumber(),
                         String8(spanTag).string(), String8(*outString).string());
                 fprintf(stderr, "%s:%d: warning: empty '%s' span found in text '%s'\n",
                         fileName, inXml->getLineNumber(),
                         String8(spanTag).string(), String8(*outString).string());