mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +02:00
Merge pull request #18486 from Snuffleupagus/AppOptions-replace-locale
Replace the GENERIC-only "locale" with "localeProperties" in AppOptions
This commit is contained in:
commit
cb737512de
3 changed files with 6 additions and 8 deletions
|
@ -336,7 +336,7 @@ const PDFViewerApplication = {
|
||||||
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
|
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
|
||||||
params.has("locale")
|
params.has("locale")
|
||||||
) {
|
) {
|
||||||
AppOptions.set("locale", params.get("locale"));
|
AppOptions.set("localeProperties", { lang: params.get("locale") });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set some specific preferences for tests.
|
// Set some specific preferences for tests.
|
||||||
|
|
|
@ -90,7 +90,10 @@ const defaultOptions = {
|
||||||
},
|
},
|
||||||
localeProperties: {
|
localeProperties: {
|
||||||
/** @type {Object} */
|
/** @type {Object} */
|
||||||
value: null,
|
value:
|
||||||
|
typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")
|
||||||
|
? { lang: navigator.language || "en-US" }
|
||||||
|
: null,
|
||||||
kind: OptionKind.BROWSER,
|
kind: OptionKind.BROWSER,
|
||||||
},
|
},
|
||||||
nimbusDataStr: {
|
nimbusDataStr: {
|
||||||
|
@ -473,11 +476,6 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||||
value: typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING"),
|
value: typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING"),
|
||||||
kind: OptionKind.VIEWER,
|
kind: OptionKind.VIEWER,
|
||||||
};
|
};
|
||||||
defaultOptions.locale = {
|
|
||||||
/** @type {string} */
|
|
||||||
value: navigator.language || "en-US",
|
|
||||||
kind: OptionKind.VIEWER,
|
|
||||||
};
|
|
||||||
} else if (PDFJSDev.test("CHROME")) {
|
} else if (PDFJSDev.test("CHROME")) {
|
||||||
defaultOptions.disableTelemetry = {
|
defaultOptions.disableTelemetry = {
|
||||||
/** @type {boolean} */
|
/** @type {boolean} */
|
||||||
|
|
|
@ -39,7 +39,7 @@ class Preferences extends BasePreferences {
|
||||||
|
|
||||||
class ExternalServices extends BaseExternalServices {
|
class ExternalServices extends BaseExternalServices {
|
||||||
async createL10n() {
|
async createL10n() {
|
||||||
return new GenericL10n(AppOptions.get("locale"));
|
return new GenericL10n(AppOptions.get("localeProperties")?.lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
createScripting() {
|
createScripting() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue