Skip to content

Commit

Permalink
Localization of the print dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Oct 8, 2016
1 parent d48f9e4 commit 5268933
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions l10n/en-US/viewer.properties
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ document_properties_version=PDF Version:
document_properties_page_count=Page Count:
document_properties_close=Close

print_progress_message=Preparing document for printing…
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
# a numerical per cent value.
print_progress_percent={{progress}}%
print_progress_close=Cancel

# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
Expand Down
4 changes: 3 additions & 1 deletion web/pdf_print_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
root.pdfjsWebOverlayManager, root.pdfjsWebApp, root.pdfjsWebPDFJS);
}
}(this, function (exports, uiUtils, overlayManager, app, pdfjsLib) {
var mozL10n = uiUtils.mozL10n;
var CSS_UNITS = uiUtils.CSS_UNITS;
var PDFPrintServiceFactory = app.PDFPrintServiceFactory;
var OverlayManager = overlayManager.OverlayManager;
Expand Down Expand Up @@ -231,7 +232,8 @@
var progressBar = progressContainer.querySelector('progress');
var progressPerc = progressContainer.querySelector('.relative-progress');
progressBar.value = progress;
progressPerc.textContent = progress + '%';
progressPerc.textContent = mozL10n.get('print_progress_percent',
{progress: progress}, progress + '%');
}

var hasAttachEvent = !!document.attachEvent;
Expand Down
6 changes: 3 additions & 3 deletions web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -364,14 +364,14 @@
<div id="printServiceOverlay" class="container hidden">
<div class="dialog">
<div class="row">
<span>Preparing document for printing...</span>
<span data-l10n-id="print_progress_message">Preparing document for printing</span>
</div>
<div class="row">
<progress value="0" max="100"></progress>
<span class="relative-progress">0%</span>
<span data-l10n-id="print_progress_percent" data-l10n-args='{ "progress": 0 }' class="relative-progress">0%</span>
</div>
<div class="buttonRow">
<button id="printCancel" class="overlayButton"><span>Cancel</span></button>
<button id="printCancel" class="overlayButton"><span data-l10n-id="print_progress_close">Cancel</span></button>
</div>
</div>
</div>
Expand Down

0 comments on commit 5268933

Please sign in to comment.