From 1730447ca19cd16e3ef4d4696f6761a0e918618e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 17 Mar 2018 17:21:15 +0100 Subject: [PATCH] Tweak the pageSize l10n strings for the document properties dialog The units are currently repeated after each dimension, which seems unnecessary and is also not done in other PDF viewers (such as e.g. Adobe Reader). Furthermore, the name of the l10n arguments can be simplified slightly, since the name of the strings themselves should be enough information. Finally, the `width`/`height` should be formatted according to the current locale, as is already done for other strings in the document properties dialog. --- l10n/en-US/viewer.properties | 12 ++++++------ l10n/sv-SE/viewer.properties | 7 +++++++ web/pdf_document_properties.js | 16 ++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/l10n/en-US/viewer.properties b/l10n/en-US/viewer.properties index 7a795712b..4533de643 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): "{{width_in}}" and "{{height_in}}" -# will be replaced by the size of the first page of the PDF file in inches. -document_properties_page_size_in={{width_in}}in × {{height_in}}in -# LOCALIZATION NOTE (document_properties_page_size_mm): "{{width_mm}}" and "{{height_mm}}" -# will be replaced by the size of the first page of the PDF file in millimeters. -document_properties_page_size_mm={{width_mm}}mm × {{height_mm}}mm +# 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_close=Close print_progress_message=Preparing document for printing… diff --git a/l10n/sv-SE/viewer.properties b/l10n/sv-SE/viewer.properties index 412b76520..8b015fa50 100644 --- a/l10n/sv-SE/viewer.properties +++ b/l10n/sv-SE/viewer.properties @@ -89,6 +89,13 @@ document_properties_creator=Skapare: 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_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 b4987b376..13a294ae0 100644 --- a/web/pdf_document_properties.js +++ b/web/pdf_document_properties.js @@ -228,15 +228,15 @@ class PDFDocumentProperties { const { width, height, } = pageSizeInches; return Promise.all([ - this.l10n.get('document_properties_page_size_in', { - width_in: Math.round(width * 100) / 100, - height_in: Math.round(height * 100) / 100, - }, '{{width_in}}in × {{height_in}}in'), + 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', { - width_mm: Math.round(width * 25.4 * 10) / 10, - height_mm: Math.round(height * 25.4 * 10) / 10, - }, '{{width_mm}}mm × {{height_mm}}mm'), + 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],