Skip to content

Commit

Permalink
Skip resource files for locales en-XA and ar-XB
Browse files Browse the repository at this point in the history
during packaging if pseudolocalization was done automatically.
This prevents attemts to add same resource twice.

Change-Id: I51e17f961ac44047bf466ce4aa0d4d17f4ded0d6
  • Loading branch information
iverg committed May 6, 2014
1 parent 83a538e commit 47843df
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/aapt/ResourceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 47843df

Please sign in to comment.