diff options
author | Elliott Hughes <enh@google.com> | 2014-05-06 02:25:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-06 02:25:05 +0000 |
commit | f1f28d1d86aea6dd1419e94aadf051e433914680 (patch) | |
tree | c217bcbb944e5bb40fb1a69e2c16cd66ffab25a1 | |
parent | a85db5ab785c59726c3644999801e48f449714f3 (diff) | |
parent | 47843df11fe88b30abcac324173b6c15f16cc797 (diff) | |
download | base-idea133-weekly-release.tar.gz |
Merge "Skip resource files for locales en-XA and ar-XB during packaging if pseudolocalization was done automatically. This prevents attemts to add same resource twice."idea133-weekly-release
-rw-r--r-- | tools/aapt/ResourceTable.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/aapt/ResourceTable.cpp b/tools/aapt/ResourceTable.cpp index a8ef0a00beb0..cf271a9e1ac8 100644 --- a/tools/aapt/ResourceTable.cpp +++ b/tools/aapt/ResourceTable.cpp @@ -865,6 +865,21 @@ status_t compileResourceFile(Bundle* bundle, pseudoBidiParams.country[0] = 'X'; pseudoBidiParams.country[1] = 'B'; + // We should skip resources for pseudolocales if they were + // already added automatically. This is a fix for a transition period when + // manually pseudolocalized resources may be expected. + // TODO: remove this check after next SDK version release. + if ((bundle->getPseudolocalize() & PSEUDO_ACCENTED && + curParams.locale == pseudoParams.locale) || + (bundle->getPseudolocalize() & PSEUDO_BIDI && + curParams.locale == pseudoBidiParams.locale)) { + SourcePos(in->getPrintableSource(), 0).warning( + "Resource file %s is skipped as pseudolocalization" + " was done automatically.", + in->getPrintableSource().string()); + return NO_ERROR; + } + while ((code=block.next()) != ResXMLTree::END_DOCUMENT && code != ResXMLTree::BAD_DOCUMENT) { if (code == ResXMLTree::START_TAG) { const String16* curTag = NULL; |