Commit Graph

75 Commits

Author SHA1 Message Date
Calixte Denizet
7580770aac Update l10n files 2024-01-14 21:18:58 +01:00
Jonas Jenwald
0324187734 Update l10n files 2023-12-23 12:32:00 +01:00
Tim van der Meij
ab692f805a
Update translations to the most recent versions 2023-11-25 19:34:44 +01:00
Tim van der Meij
447eeeba4d
Update translations to the most recent versions 2023-10-29 14:29:56 +01:00
Calixte Denizet
2967eca605 Update the path to get all locales and update locales 2023-10-25 12:47:06 +02:00
Calixte Denizet
66982a2a11 [api-minor] Move to Fluent for the localization (bug 1858715)
- For the generic viewer we use @fluent/dom and @fluent/bundle
- For the builtin pdf viewer in Firefox, we set a localization url
  and then we rely on document.l10n which is a DOMLocalization object.
2023-10-19 11:20:41 +02:00
Jonas Jenwald
073a1da6f5 Update l10n files 2023-09-24 11:05:37 +02:00
Jonas Jenwald
d762986bb0 Update l10n files 2023-08-19 09:30:41 +02:00
Jonas Jenwald
1182f4965d Update l10n files 2023-08-06 09:25:38 +02:00
Jonas Jenwald
fd6b9d7b48 Update l10n files 2023-07-23 09:54:11 +02:00
Jonas Jenwald
cec2a9a03f Update l10n files 2023-07-08 09:36:47 +02:00
Jonas Jenwald
62f47588b4 Update l10n files 2023-05-14 10:15:01 +02:00
Jonas Jenwald
52d61aceda Update l10n files 2023-01-28 08:15:21 +01:00
Jonas Jenwald
b85ce7f761 Update l10n files 2022-11-13 21:32:12 +01:00
Jonas Jenwald
03775917db Update the l10n-strings for the download-buttons (bug 1662416)
According to https://bugzilla.mozilla.org/show_bug.cgi?id=1662416#c8
2022-10-24 18:29:44 +02:00
Jonas Jenwald
db215fe289 Update l10n files 2022-10-16 09:39:00 +02:00
Jonas Jenwald
1a04a38a06 Update l10n files 2022-09-18 10:34:53 +02:00
Jonas Jenwald
38cf588eee Update l10n files 2022-08-07 10:22:40 +02:00
Jonas Jenwald
635bd12050 Update l10n files 2022-07-31 10:23:00 +02:00
Jonas Jenwald
ca9172ddec Update l10n files 2022-07-24 08:56:47 +02:00
Tim van der Meij
f7d69aab15
Update translations to the most recent versions 2022-06-25 15:45:55 +02:00
Jonas Jenwald
114d5e68af Update l10n files 2022-03-06 10:45:24 +01:00
Jonas Jenwald
511458fbbc Add a new Page scrolling mode (issue 2638, 8952, 10907)
This implements a new Page scrolling mode, essentially bringing (and extending) the functionality from `PDFSinglePageViewer` into the regular `PDFViewer`-class. Compared to `PDFSinglePageViewer`, which as its name suggests will only display one page at a time, in the `PDFViewer`-implementation this new Page scrolling mode also support spreadModes properly (somewhat similar to e.g. Adobe Reader).

Given the size and scope of these changes, I've tried to focus on implementing the basic functionality. Hence there's room for further clean-up and/or improvements, including e.g. simplifying the CSS/JS related to PresentationMode and implementing easier page-switching with the mouse-wheel/arrow-keys.
2021-10-12 13:45:15 +02:00
Jonas Jenwald
32ad677f9c Update l10n files 2021-09-19 09:43:15 +02:00
Jonas Jenwald
aad0316137 Update l10n files 2021-07-25 10:31:40 +02:00
Jonas Jenwald
d3ed3761bc Update l10n files 2021-04-18 11:24:51 +02:00
Jonas Jenwald
4814e23310 Add (temporary) Swedish localizations for the page_landmark/loading strings (PR 13118 follow-up)
I'm adding these temporary l10n strings, so that I don't have to stare at a bunch of warning messages in the web-console when using the development viewer.
2021-03-21 11:12:20 +01:00
Jonas Jenwald
6e2ae2264b Remove the unused "loading_error_indicator" l10n string (PR 2719 follow-up)
This l10n string has been completely unused ever since PR 2719, which is now *eight* years ago.
2021-02-12 13:12:37 +01:00
Jonas Jenwald
09442351b8 Update l10n files 2021-01-24 08:43:09 +01:00
Jonas Jenwald
5729c0b32f Add support for finding/highlighting the outlineItem, corresponding to the currently visible page, in the sidebar (issue 7557, bug 1253820, bug 1499050)
This implementation is inspired by the behaviour in (recent versions of) Adobe Reader, since it leads to reasonably simple and straightforward code as far as I'm concerned.
*Specifically:* We'll only consider *one* destination per page when finding/highlighting the current outline item, which is similar to e.g. Adobe Reader, and we choose the *first* outline item at the *lowest* level of the outline tree.

Given that this functionality requires not only parsing of the `outline`, but looking up *all* of the destinations in the document, this feature can when initialized have a non-trivial performance overhead for larger PDF documents.
In an attempt to reduce the performance impact, the following steps are taken here:

 - The "find current outline item"-functionality will only be enabled once *one* page has rendered and *all* the pages have been loaded[1], to prevent it interfering with data regular fetching/parsing early on during document loading and viewer initialization.

 - With the exception of a couple of small and simple `eventBus`-listeners, in `PDFOutlineViewer`, this new functionality is initialized *lazily* the first time that the user clicks on the `currentOutlineItem`-button.

 - The entire "find current outline item"-functionality is disabled when `disableAutoFetch = true` is set, since it can easily lead to the setting becoming essentially pointless[2] by triggering *a lot* of data fetching from a relatively minor viewer-feature.

 - Fetch the destinations *individually*, since that's generally more efficient than using `PDFDocumentProxy.getDestinations` to fetch them all at once. Despite making the overall parsing code *more* asynchronous, and leading to a lot more main/worker-thread message passing, in practice this seems faster for larger documents.

Finally, we'll now always highlight an outline item that the user manually clicked on, since only highlighting when the new "find current outline item"-functionality is used seemed inconsistent.

---
[1] Keep in mind that the `outline` itself already isn't fetched/parsed until at least *one* page has been rendered in the viewer.

[2] And also quite slow, since it can take a fair amount of time to fetch all of the necessary `destinations` data when `disableAutoFetch = true` is set.
2021-01-09 16:09:44 +01:00
Jonas Jenwald
54eeaba014 Update l10n files 2020-09-06 11:51:34 +02:00
Jonas Jenwald
66aabe3ec7 [api-minor] Add support for toggling of Optional Content in the viewer (issue 12096)
*Besides, obviously, adding viewer support:* This patch attempts to improve the general API for Optional Content Groups slightly, by adding a couple of new methods for interacting with the (more complex) data structures of `OptionalContentConfig`-instances. (Thus allowing us to mark some of the data as "private", given that it probably shouldn't be manipulated directly.)

By utilizing not just the "raw" Optional Content Groups, but the data from the `/Order` array when available, we can thus display the Layers in a proper tree-structure with collapsible headings for PDF documents that utilizes that feature.

Note that it's possible to reset all Optional Content Groups to their default visibility state, simply by double-clicking on the Layers-button in the sidebar.
(Currently that's indicated in the Layers-button tooltip, which is obviously easy to overlook, however it's probably the best we can do for now without adding more buttons, or even a dropdown-toolbar, to the sidebar.)

Also, the current Layers-button icons are a little rough around the edges, quite literally, but given that the viewer will soon have its UI modernized anyway they hopefully suffice in the meantime.

To give users *full* control of the visibility of the various Optional Content Groups, even those which according to the `/Order` array should not (by default) be toggleable in the UI, this patch will place those under a *custom* heading which:
 - Is collapsed by default, and placed at the bottom of the Layers-tree, to be a bit less obtrusive.
 - Uses a slightly different formatting, compared to the "regular" headings.
 - Is localizable.

Finally, note that the thumbnails are *purposely* always rendered with all Optional Content Groups at their default visibility state, since that seems the most useful and it's also consistent with other viewers.
To ensure that this works as intended, we'll thus disable the `PDFThumbnailView.setImage` functionality when the Optional Content Groups have been changed in the viewer. (This obviously means that we'll re-render thumbnails instead of using the rendered pages. However, this situation ought to be rare enough for this to not really be a problem.)
2020-08-30 16:28:40 +02:00
Jonas Jenwald
ba8c5bde5f Update l10n files 2020-08-23 10:10:38 +02:00
Jonas Jenwald
16a94412e4 Remove the unused id properties from page and thumbnail canvas/image DOM elements (issue 11499)
As described in the issue, having a DOM element with `id=page2` (or any other number) will automatically cause that element to become linkable through the URL hash. That's currently leading to some confusing and outright wrong behaviour, since it obviously only works for pages that have been loaded and rendered.

For PDF documents the only officially supported way to reference a particular page through the URL hash is using the `#page=2` format, which also works for all pages regardless if they're loaded or not.

As far as I can tell there's nothing in the PDF.js default viewer that actually depends on the page/thumbnail `id` at this point in time, hence why I believe that this removal ought to be safe.
Just as a pre-caution this patch adds an `aria-label` to the page canvas, similar to the thumbnail canvas/image, to at least keep this information in the DOM.
2020-01-11 14:11:47 +01:00
Jonas Jenwald
b663cec383 [Firefox] Stop fetching the chrome.properties files during gulp importl10n (PR 9566 follow-up)
With the removal of the (standalone) Firefox building code in PR 9566 (a year and a half ago), these files are now completely unused in the GitHub repository[1].
Hence it doesn't really seem necessary to keep fetching them with `gulp importl10n`, and the existing files in the `l10n` folder can also be removed (thanks to version control, they're easy enough to restore should the need ever arise).

The patch also allows an additional simplification, for the `gulp locale` and `gulp mozcentral` commands, since it's now possible to stop writing `l10n` files to the `extensions/firefox/` folder and instead just copy them similar to other build targets.

---
[1] They're obviously still used in `mozilla-central`, for fallback messages displayed through `PdfStreamConverter.jsm`, but that doesn't make it necessary to keep them *here* as far as I'm concerned.
2019-10-17 12:27:11 +02:00
Jonas Jenwald
8a057dcf90 [Firefox] Stop building the metadata.inc/chrome.manifest.inc files during gulp locale (PR 9566 follow-up)
With the removal of the (standalone) Firefox building code in PR 9566 (a year and a half ago), these files are now completely unused.
Hence it doesn't really make sense to keep building them as part of `gulp locale`, and the existing files in the `l10n` folder can also be removed (thanks to version control, they're easy enough to restore should the need ever arise).
2019-10-17 11:49:30 +02:00
Tim van der Meij
1f3723f54c
Update translations 2019-05-25 16:21:09 +02:00
Tim van der Meij
3c9e25b839
Update translations 2018-09-21 15:26:10 +02:00
Tim van der Meij
f711dbc011
Improve plural support for the matches counter 2018-09-16 14:23:06 +02:00
Jonas Jenwald
6c4157acd9 Attempt to support plural forms in the matches counter of the findbar (issue 10067)
Based on a quick look at https://github.com/fabi1cazenave/webL10n/#pluralization, it seems that supporting plural forms shouldn't be as difficult as I first thought it might be.
2018-09-13 13:50:51 +02:00
Jonas Jenwald
6d804d657f Add initial support for "Whole words" searching in the viewer
As outlined in https://bugzilla.mozilla.org/show_bug.cgi?id=1282759 the internal Firefox name for the feature is `entireWord`, hence that name is used here as well for consistency (with "Whole words" being limited to the UI).

Given existing limitations of the PDF.js search functionality, e.g. the existing problems of searching across "new lines", there's some edge-cases where "Whole words" searching will ignore (valid) results.
However, considering that this is a pre-existing issue related to the way that the find controller joins text-content together, that shouldn't have to block this new feature in my opionion.

*Please note:* In order to enable this feature in the `MOZCENTRAL` version, a small follow-up patch for [PdfjsChromeUtils.jsm](https://hg.mozilla.org/mozilla-central/file/tip/browser/extensions/pdfjs/content/PdfjsChromeUtils.jsm) will be required once this has landed in `mozilla-central`.
2018-09-10 11:59:29 +02:00
Jonas Jenwald
c9a2564882 Display the index of the currently active search result in the matches counter of the findbar (issue 6993, bug 1062025)
For the `PDFFindBar` implementation, similar to the native Firefox findbar, the matches count displayed is now limited to a (hopefully) reasonable value.

*Please note:* In order to enable this feature in the `MOZCENTRAL` version, a follow-up patch will be required once this has landed in `mozilla-central`.
2018-09-08 21:50:22 +02:00
Jonas Jenwald
522040d130 Expose the Linearization status in the document properties dialog
This uses the same terminology, i.e. "Fast Web View", as is used by Adobe software.
2018-07-26 17:30:46 +02:00
Tim van der Meij
32a44a054f
Import translations 2018-06-09 14:32:45 +02:00
Tim van der Meij
e0b63cc7af
Update packages and translations 2018-04-08 15:49:17 +02:00
Jonas Jenwald
d86b816c2b Display the names, for a couple of standard page sizes, in the document properties dialog
Please note that this patch *purposely* doesn't add every standard (or semi-standard) page name in existence, but rather only a few common ones. This is done to lessen the burden on localizers, since it's quite possible that all of the page names could need translation (depending on locale).

It's easy to add more standard page sizes in the future, but we should take care to *only* add those that are very commonly used in actual PDF files.
2018-03-25 18:50:17 +02:00
Jonas Jenwald
fc0038d609 Add orientation description to the pageSize information, displayed in the properties dialog
Since the l10n strings were added in a previous commit, modifying them here shouldn't be a problem since they haven't landed in mozilla-central yet.
2018-03-25 18:50:17 +02:00
Jonas Jenwald
b7b5d93231 Reduce the duplication for the document_properties_page_size_* strings, by defining the units separately 2018-03-25 18:48:53 +02:00
Jonas Jenwald
1730447ca1 Tweak the pageSize l10n strings for the document properties dialog
The units are currently repeated after each dimension, which seems unnecessary and is also not done in other PDF viewers (such as e.g. Adobe Reader).

Furthermore, the name of the l10n arguments can be simplified slightly, since the name of the strings themselves should be enough information.

Finally, the `width`/`height` should be formatted according to the current locale, as is already done for other strings in the document properties dialog.
2018-03-18 09:10:21 +01:00
Jonas Jenwald
e696589a09 Update l10n files 2017-06-05 12:45:42 +02:00