diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties index 4533de643..a20f72219 100644 --- a/l10n/en-US/viewer.properties +++ b/l10n/en-US/viewer.properties @@ -90,12 +90,12 @@ document_properties_producer=PDF Producer: document_properties_version=PDF Version: document_properties_page_count=Page Count: document_properties_page_size=Page Size: -# LOCALIZATION NOTE (document_properties_page_size_in_2): "{{width}}" and "{{height}}" -# will be replaced by the size of the (current) page, in inches. -document_properties_page_size_in_2={{width}} × {{height}} in -# LOCALIZATION NOTE (document_properties_page_size_mm_2): "{{width}}" and "{{height}}" -# will be replaced by the size of the (current) page, in millimeters. -document_properties_page_size_mm_2={{width}} × {{height}} mm +document_properties_page_size_unit_inches=in +document_properties_page_size_unit_millimeters=mm +# LOCALIZATION NOTE (document_properties_page_size_dimension_string): +# "{{width}}", "{{height}}", and {{unit}} will be replaced by the size, +# respectively their unit of measurement, of the (current) page. +document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} document_properties_close=Close print_progress_message=Preparing document for printing… diff --git a/l10n/sv-SE/viewer.properties b/l10n/sv-SE/viewer.properties index 8b015fa50..59f4a99d3 100644 --- a/l10n/sv-SE/viewer.properties +++ b/l10n/sv-SE/viewer.properties @@ -90,12 +90,12 @@ document_properties_producer=PDF-producent: document_properties_version=PDF-version: document_properties_page_count=Sidantal: document_properties_page_size=Sidstorlek: -# LOCALIZATION NOTE (document_properties_page_size_in_2): "{{width}}" and "{{height}}" -# will be replaced by the size of the (current) page, in inches. -document_properties_page_size_in_2={{width}} × {{height}} tum -# LOCALIZATION NOTE (document_properties_page_size_mm_2): "{{width}}" and "{{height}}" -# will be replaced by the size of the (current) page, in millimeters. -document_properties_page_size_mm_2={{width}} × {{height}} mm +document_properties_page_size_unit_inches=tum +document_properties_page_size_unit_millimeters=mm +# LOCALIZATION NOTE (document_properties_page_size_dimension_string): +# "{{width}}", "{{height}}", and {{unit}} will be replaced by the size, +# respectively their unit of measurement, of the (current) page. +document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} document_properties_close=Stäng print_progress_message=Förbereder sidor för utskrift… diff --git a/web/pdf_document_properties.js b/web/pdf_document_properties.js index cb5d81e8f..31033a61c 100644 --- a/web/pdf_document_properties.js +++ b/web/pdf_document_properties.js @@ -247,20 +247,25 @@ class PDFDocumentProperties { const { width, height, } = pageSizeInches; return Promise.all([ - this.l10n.get('document_properties_page_size_in_2', { - width: (Math.round(width * 100) / 100).toLocaleString(), - height: (Math.round(height * 100) / 100).toLocaleString(), - }, '{{width}} × {{height}} in'), - // 1in = 25.4mm; no need to round to 2 decimals for millimeters. - this.l10n.get('document_properties_page_size_mm_2', { - width: (Math.round(width * 25.4 * 10) / 10).toLocaleString(), - height: (Math.round(height * 25.4 * 10) / 10).toLocaleString(), - }, '{{width}} × {{height}} mm'), - ]).then((sizes) => { - return { - inch: sizes[0], - mm: sizes[1], - }; + this.l10n.get('document_properties_page_size_unit_inches', null, 'in'), + this.l10n.get('document_properties_page_size_unit_millimeters', null, + 'mm'), + ]).then(([unitInches, unitMillimeters]) => { + return Promise.all([ + this.l10n.get('document_properties_page_size_dimension_string', { + width: (Math.round(width * 100) / 100).toLocaleString(), + height: (Math.round(height * 100) / 100).toLocaleString(), + unit: unitInches, + }, '{{width}} × {{height}} {{unit}}'), + // 1in == 25.4mm; no need to round to 2 decimals for millimeters. + this.l10n.get('document_properties_page_size_dimension_string', { + width: (Math.round(width * 25.4 * 10) / 10).toLocaleString(), + height: (Math.round(height * 25.4 * 10) / 10).toLocaleString(), + unit: unitMillimeters, + }, '{{width}} × {{height}} {{unit}}'), + ]); + }).then((sizes) => { + return { inch: sizes[0], mm: sizes[1], }; }); }