1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 22:58:07 +02:00

[api-minor] Use "data-l10n-id"/"data-l10n-args", rather than manually updating DOM-elements, to trigger translation (PR 17146 follow-up)

This patch changes almost all viewer-components[1] to use "data-l10n-id"/"data-l10n-args" for localization, which means that in many cases we no longer need to pass around the `L10n`-instance any more.

One part of the code-base where the `L10n`-instance is still being used "directly" is the AnnotationEditors, however while it might be possible to convert (most of) that code as well that's not attempted in this patch.

---
[1] The one exception is the `PDFDocumentProperties` dialog, since the way it's currently implemented makes that less straightforward to fix without a lot of code changes.
This commit is contained in:
Jonas Jenwald 2023-10-19 16:30:57 +02:00
parent 898cc2e399
commit 17af706070
17 changed files with 117 additions and 149 deletions

View file

@ -218,11 +218,13 @@ pdfjs-additional-layers = Additional Layers
# Variables:
# $page (Number) - the page number
pdfjs-thumb-page-title = Page { $page }
pdfjs-thumb-page-title =
.title = Page { $page }
# Variables:
# $page (Number) - the page number
pdfjs-thumb-page-canvas = Thumbnail of Page { $page }
pdfjs-thumb-page-canvas =
.aria-label = Thumbnail of Page { $page }
## Find panel button title and messages
@ -276,7 +278,8 @@ pdfjs-page-scale-percent = { $scale }%
# Variables:
# $page (Number) - the page number
pdfjs-page-landmark = Page { $page }
pdfjs-page-landmark =
.aria-label = Page { $page }
## Loading indicator messages