mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Utilize Fluent to format numbers and dates in PDFDocumentProperties
The `PDFDocumentProperties` dialog may not display correctly formatted data, especially in the GENERIC viewer, since it's using native methods[1] that depend on the *browser* locale instead of the viewer locale as intended. At the time when this dialog was introduced that was probably all we could easily do, but with Fluent we're able to improve things since it's got built-in support for formatting numbers and dates. Not only does this simplify the JavaScript code, but it also gives the localizer more fine-grained control of the desired output. Please find additional information here: - https://projectfluent.org/fluent/guide/builtins.html - https://projectfluent.org/fluent/guide/functions.html --- [1] `toLocaleString`, `toLocaleDateString`, and `toLocaleTimeString`.
This commit is contained in:
parent
037c181af6
commit
d96558836e
2 changed files with 18 additions and 34 deletions
|
@ -113,14 +113,14 @@ pdfjs-document-properties-file-name = File name:
|
|||
pdfjs-document-properties-file-size = File size:
|
||||
|
||||
# Variables:
|
||||
# $size_kb (Number) - the PDF file size in kilobytes
|
||||
# $size_b (Number) - the PDF file size in bytes
|
||||
pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes)
|
||||
# $kb (Number) - the PDF file size in kilobytes
|
||||
# $b (Number) - the PDF file size in bytes
|
||||
pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)
|
||||
|
||||
# Variables:
|
||||
# $size_mb (Number) - the PDF file size in megabytes
|
||||
# $size_b (Number) - the PDF file size in bytes
|
||||
pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)
|
||||
# $mb (Number) - the PDF file size in megabytes
|
||||
# $b (Number) - the PDF file size in bytes
|
||||
pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)
|
||||
|
||||
pdfjs-document-properties-title = Title:
|
||||
pdfjs-document-properties-author = Author:
|
||||
|
@ -130,9 +130,8 @@ pdfjs-document-properties-creation-date = Creation Date:
|
|||
pdfjs-document-properties-modification-date = Modification Date:
|
||||
|
||||
# Variables:
|
||||
# $date (Date) - the creation/modification date of the PDF file
|
||||
# $time (Time) - the creation/modification time of the PDF file
|
||||
pdfjs-document-properties-date-string = { $date }, { $time }
|
||||
# $dateObj (Date) - the creation/modification date and time of the PDF file
|
||||
pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") }
|
||||
|
||||
pdfjs-document-properties-creator = Creator:
|
||||
pdfjs-document-properties-producer = PDF Producer:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue