f07675a6a8
*Please note:* These changes only affect the GENERIC build, since `NullL10n` is only a stub elsewhere (see PR 17135). After the changes in PR 17115, which modernized and improved l10n-handling, the `NullL10n`-implementation is no longer a good fallback for the "proper" `L10n`-classes. To improve this situation, especially for the *standalone* viewer-components, this patch makes the following changes: - Let the `NullL10n`-implementation extend an actual `L10n`-class, which is constant and lazily initialized, to ensure that it works *exactly* like the "proper" ones. - Automatically bundle the "en-US" l10n-strings in the build, via the pre-processor, such that we don't need to remember to manually update them. - Ensure that the *standalone* viewer-components register their DOM-elements for translation, similar to the default viewer, since this will allow future code improvements by using "data-l10n-id"/"data-l10n-args" in most (if not all) parts of the viewer. - Remove the `NullL10n` from the `AnnotationLayer`, to avoid affecting bundle size too much. For third-party users that access the `AnnotationLayer`, as exposed in the main PDF.js library, they'll now need to *manually* register it for translation. (However, the *standalone* viewer-components still works given the point above.)
27 lines
799 B
JSON
27 lines
799 B
JSON
{
|
|
"compilerOptions": {
|
|
"target": "ESNext",
|
|
"allowJs": true,
|
|
"declaration": true,
|
|
"strict": true,
|
|
"emitDeclarationOnly": true,
|
|
"esModuleInterop": true,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"moduleResolution": "node",
|
|
"paths": {
|
|
"pdfjs-lib": ["./src/pdf"],
|
|
"display-fetch_stream": ["./src/display/fetch_stream"],
|
|
"display-network": ["./src/display/network"],
|
|
"display-node_stream": ["./src/display/node_stream"],
|
|
"display-node_utils": ["./src/display/node_utils"],
|
|
"fluent-bundle": ["./node_modules/@fluent/bundle/esm/index.js"],
|
|
"fluent-dom": ["./node_modules/@fluent/dom/esm/index.js"],
|
|
"web-l10n_utils": ["./web/l10n_utils"]
|
|
}
|
|
},
|
|
"files": [
|
|
"src/pdf.js",
|
|
"web/pdf_viewer.component.js"
|
|
]
|
|
}
|