Merge pull request #17151 from Snuffleupagus/Fluent-PDFDocumentProperties-fixes

A couple of `PDFDocumentProperties` tweaks (PR 17115 follow-up)
This commit is contained in:
Tim van der Meij 2023-10-22 12:33:34 +02:00 committed by GitHub
commit 898cc2e399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,13 +19,14 @@ import { PDFDateString, PromiseCapability } from "pdfjs-lib";
const DEFAULT_FIELD_CONTENT = "-"; const DEFAULT_FIELD_CONTENT = "-";
// See https://en.wikibooks.org/wiki/Lentis/Conversion_to_the_Metric_Standard_in_the_United_States // See https://en.wikibooks.org/wiki/Lentis/Conversion_to_the_Metric_Standard_in_the_United_States
const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"]; const NON_METRIC_LOCALES = ["en-US", "en-LR", "my"];
// Should use the format: `width x height`, in portrait orientation. // Should use the format: `width x height`, in portrait orientation. The names,
// which are l10n-ids, should be lowercase.
// See https://en.wikipedia.org/wiki/Paper_size // See https://en.wikipedia.org/wiki/Paper_size
const US_PAGE_NAMES = { const US_PAGE_NAMES = {
"8.5x11": "Letter", "8.5x11": "letter",
"8.5x14": "Legal", "8.5x14": "legal",
}; };
const METRIC_PAGE_NAMES = { const METRIC_PAGE_NAMES = {
"297x420": "a-three", "297x420": "a-three",
@ -312,9 +313,7 @@ class PDFDocumentProperties {
}` }`
), ),
rawName && rawName &&
this.l10n.get( this.l10n.get(`pdfjs-document-properties-page-size-name-${rawName}`),
`pdfjs-document-properties-page-size-name-${rawName.toLowerCase()}`
),
this.l10n.get( this.l10n.get(
`pdfjs-document-properties-page-size-orientation-${ `pdfjs-document-properties-page-size-orientation-${
isPortrait ? "portrait" : "landscape" isPortrait ? "portrait" : "landscape"