summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceParser.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2016-01-06 23:55:06 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2016-01-06 23:55:06 +0000
commit198ce1a5e6fbe2cb84263e427032e9715e27379f (patch)
tree79ee0d9b3f968f2c0b58ff08ef4a75cd5415f563 /tools/aapt2/ResourceParser.cpp
parentf68f066cdfbd9df6fcab30ed034640c7a81d2cfe (diff)
parent393b5f0d6130d3848dd82075986a5cf40c09ce44 (diff)
Merge "AAPT2: Port AAPT pseudolocalization to AAPT2"
Diffstat (limited to 'tools/aapt2/ResourceParser.cpp')
-rw-r--r--tools/aapt2/ResourceParser.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/aapt2/ResourceParser.cpp b/tools/aapt2/ResourceParser.cpp
index 6a0787331e02..1e879a0e5f49 100644
--- a/tools/aapt2/ResourceParser.cpp
+++ b/tools/aapt2/ResourceParser.cpp
@@ -564,8 +564,10 @@ bool ResourceParser::parseString(xml::XmlPullParser* parser, ParsedResource* out
return false;
}
- if (formatted && translateable) {
- if (String* stringValue = valueCast<String>(outResource->value.get())) {
+ if (String* stringValue = valueCast<String>(outResource->value.get())) {
+ stringValue->setTranslateable(translateable);
+
+ if (formatted && translateable) {
if (!util::verifyJavaStringFormat(*stringValue->value)) {
mDiag->error(DiagMessage(outResource->source)
<< "multiple substitutions specified in non-positional format; "
@@ -573,6 +575,9 @@ bool ResourceParser::parseString(xml::XmlPullParser* parser, ParsedResource* out
return false;
}
}
+
+ } else if (StyledString* stringValue = valueCast<StyledString>(outResource->value.get())) {
+ stringValue->setTranslateable(translateable);
}
return true;
}