Commit c6466c39 authored by Alex Danilo's avatar Alex Danilo Committed by Commit Bot

i18n strings for the summary feedback panel

Adds percentage complete string for translation.

Bug: 1014771
Change-Id: I043b9f8127fe51732eb65ccbb68ed1257c02d901
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1890401
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711630}
parent 739ef116
......@@ -537,6 +537,7 @@ std::unique_ptr<base::DictionaryValue> GetFileManagerStrings() {
IDS_FORMATTING_OF_DEVICE_PENDING_TITLE);
SET_STRING("FORMATTING_WARNING", IDS_FILE_BROWSER_FORMATTING_WARNING);
SET_STRING("PAUSE_LABEL", IDS_FILE_BROWSER_PAUSE_LABEL);
SET_STRING("PERCENT_COMPLETE", IDS_FILE_BROWSER_PERCENT_COMPLETE);
SET_STRING("RENAMING_OF_DEVICE_FINISHED_FAILURE_MESSAGE",
IDS_RENAMING_OF_DEVICE_FINISHED_FAILURE_MESSAGE);
SET_STRING("RENAMING_OF_DEVICE_FAILED_TITLE",
......
......@@ -817,6 +817,9 @@
<message name="IDS_FILE_BROWSER_ERROR_PROGRESS_SUMMARY_PLURAL" desc="Summary message for multiple errors above the progress bar. This message may be placed at the next to ohter *_PROGERSS_SUMMARY messages.">
<ph name="COUNT">$1<ex>10</ex></ph> errors.
</message>
<message name="IDS_FILE_BROWSER_PERCENT_COMPLETE" desc="Percentage of file operation that is complete in a progress message.">
<ph name="PERCENT">$1<ex>10</ex></ph>% complete.
</message>
<message name="IDS_FILE_BROWSER_CANCEL_ACTIVITY_LABEL" desc="Text spoken by ChromeVox/screen reader describing what will be cancelled.">
Cancel <ph name="ACTIVITY_DESCRIPTION">$1<ex>Copying file.txt</ex></ph>.
......
364f69c8223d170c8bd7f7ae496ccf7abaaa1ee4
\ No newline at end of file
......@@ -393,6 +393,9 @@ function strf(id, var_args) {
return loadTimeData.getStringF.apply(loadTimeData, arguments);
}
// Export strf() into the util namespace.
util.strf = strf;
/**
* @return {boolean} True if the Files app is running as an open files or a
* select folder dialog. False otherwise.
......
......@@ -163,6 +163,7 @@ js_library("xf_circular_progress") {
js_library("xf_display_panel") {
deps = [
":xf_panel_item",
"//ui/file_manager/file_manager/common/js:util",
]
}
......
......@@ -134,6 +134,11 @@ async function testDisplayPanelChangingPanelTypes(done) {
done();
}
// Override thr formatting function for unit testing.
util.strf = (end, option) => {
return option + end;
};
function testFilesDisplayPanelErrorMarker() {
// Get the host display panel container element.
/** @type {!DisplayPanel|!Element} */
......
......@@ -264,8 +264,8 @@ class DisplayPanel extends HTMLElement {
if (summaryPanel.indicator != 'largeprogress') {
summaryPanel.indicator = 'largeprogress';
}
// TODO(crbug.com/947388) i18n this string (add setter).
summaryPanel.primaryText = total.toFixed(0) + '% complete';
summaryPanel.primaryText =
util.strf('PERCENT_COMPLETE', total.toFixed(0));
summaryPanel.progress = total;
summaryPanel.setAttribute('count', progressCount);
summaryPanel.errorMarkerVisibility =
......@@ -277,8 +277,8 @@ class DisplayPanel extends HTMLElement {
summaryPanel.indicator = 'status';
summaryPanel.status = 'failure';
}
// TODO(crbug.com/947388) i18n this string (add setter/callback?).
summaryPanel.primaryText = errors + ' errors';
summaryPanel.primaryText =
util.strf('ERROR_PROGRESS_SUMMARY_PLURAL', errors);
}
}
}
......
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