Commit c896a653 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Convert IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE to an inline string

Having non-translated strings in .pak files is quite inefficient since
they are copied into each locale .pak file.

Changing this one string decreases apk size by 3,641 bytes.

BUG=703134

Change-Id: I7b64c2d7a48544a7e780e3c300044fdba33b3920
Reviewed-on: https://chromium-review.googlesource.com/578214Reviewed-by: default avatarVaclav Brozek <vabr@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488655}
parent 16773291
......@@ -315,23 +315,27 @@ bool FormCache::ShowPredictions(const FormDataPredictions& form) {
0, std::min(field_data.label.length(), kMaxLabelSize));
const FormFieldDataPredictions& field = form.fields[i];
std::vector<base::string16> replacements;
base::string16 overall_type = base::UTF8ToUTF16(field.overall_type);
replacements.push_back(overall_type);
replacements.push_back(base::UTF8ToUTF16(field.server_type));
replacements.push_back(base::UTF8ToUTF16(field.heuristic_type));
replacements.push_back(truncated_label);
replacements.push_back(base::UTF8ToUTF16(field.parseable_name));
replacements.push_back(base::UTF8ToUTF16(field.signature));
replacements.push_back(base::UTF8ToUTF16(form.signature));
const base::string16 title = l10n_util::GetStringFUTF16(
IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE, replacements, nullptr);
element.SetAttribute("title", WebString::FromUTF16(title));
std::string title;
title += "overall type: ";
title += field.overall_type;
title += " server type: $2 ";
title += field.server_type;
title += " heuristic type: $3";
title += field.heuristic_type;
title += " label: $4";
title += base::UTF16ToUTF8(truncated_label);
title += " parseable name: $5";
title += field.overall_type;
title += " field signature: $6";
title += field.overall_type;
title += " form signature: $7";
title += field.overall_type;
element.SetAttribute("title", WebString::FromUTF8(title));
element.SetAttribute("autofill-prediction",
WebString::FromUTF16(overall_type));
WebString::FromUTF8(field.overall_type));
}
return true;
......
......@@ -128,16 +128,6 @@
Postal code
</message>
<message translateable="false" name="IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE" desc="The title for form elements when annotated with Autofill predictions.">
overall type: <ph name="OVERALL_TYPE">$1<ex>NAME_FIRST</ex></ph>
server type: <ph name="SERVER_TYPE">$2<ex>NAME_FIRST</ex></ph>
heuristic type: <ph name="HEURISTIC_TYPE">$3<ex>NAME_FIRST</ex></ph>
label: <ph name="LABEL">$4<ex>SOME LABEL</ex></ph>
parseable name: <ph name="PARSEABLE_NAME">$5<ex>SOME_NAME</ex></ph>
field signature: <ph name="FIELD_SIGNATURE">$6<ex>12345678</ex></ph>
form signature: <ph name="FORM_SIGNATURE">$7<ex>1234567812345678</ex></ph>
</message>
<if expr="_google_chrome">
<message name="IDS_AUTOFILL_OPTIONS_POPUP" desc="The text displayed in the Autofill popup to direct the user to the Autofill settings UI.">
Chrome Autofill settings...
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment