mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Pass in the PDFJS.locale
option to ExternalServices.createL10n
This allows us to remove an otherwise unnecessary `PDFJS` dependency from the `web/genericcom.js` file.
This commit is contained in:
parent
77efed6626
commit
74ffd1d865
4 changed files with 7 additions and 6 deletions
|
@ -17,7 +17,6 @@ import { DefaultExternalServices, PDFViewerApplication } from './app';
|
|||
import { BasePreferences } from './preferences';
|
||||
import { DownloadManager } from './download_manager';
|
||||
import { GenericL10n } from './genericl10n';
|
||||
import { PDFJS } from 'pdfjs-lib';
|
||||
|
||||
if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('GENERIC')) {
|
||||
throw new Error('Module "pdfjs-web/genericcom" shall not be used outside ' +
|
||||
|
@ -49,8 +48,8 @@ GenericExternalServices.createDownloadManager = function() {
|
|||
GenericExternalServices.createPreferences = function() {
|
||||
return new GenericPreferences();
|
||||
};
|
||||
GenericExternalServices.createL10n = function () {
|
||||
return new GenericL10n(PDFJS.locale);
|
||||
GenericExternalServices.createL10n = function(options) {
|
||||
return new GenericL10n(options.locale);
|
||||
};
|
||||
PDFViewerApplication.externalServices = GenericExternalServices;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue