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:
Jonas Jenwald 2018-02-13 14:22:14 +01:00
parent 77efed6626
commit 74ffd1d865
4 changed files with 7 additions and 6 deletions

View file

@ -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;