Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a88aa4c7 authored by David van Tonder's avatar David van Tonder Committed by Gerrit Code Review
Browse files

Merge "aapt: localizations: be more aggressive" into cm-10.1

parents dad2f2f6 50f2c48c
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -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