5729c0b32f
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.
253 lines
11 KiB
Properties
253 lines
11 KiB
Properties
# Copyright 2012 Mozilla Foundation
|
||
#
|
||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||
# you may not use this file except in compliance with the License.
|
||
# You may obtain a copy of the License at
|
||
#
|
||
# http://www.apache.org/licenses/LICENSE-2.0
|
||
#
|
||
# Unless required by applicable law or agreed to in writing, software
|
||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
# See the License for the specific language governing permissions and
|
||
# limitations under the License.
|
||
|
||
# Main toolbar buttons (tooltips and alt text for images)
|
||
previous.title=Previous Page
|
||
previous_label=Previous
|
||
next.title=Next Page
|
||
next_label=Next
|
||
|
||
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
|
||
page.title=Page
|
||
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
|
||
# representing the total number of pages in the document.
|
||
of_pages=of {{pagesCount}}
|
||
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
|
||
# will be replaced by a number representing the currently visible page,
|
||
# respectively a number representing the total number of pages in the document.
|
||
page_of_pages=({{pageNumber}} of {{pagesCount}})
|
||
|
||
zoom_out.title=Zoom Out
|
||
zoom_out_label=Zoom Out
|
||
zoom_in.title=Zoom In
|
||
zoom_in_label=Zoom In
|
||
zoom.title=Zoom
|
||
presentation_mode.title=Switch to Presentation Mode
|
||
presentation_mode_label=Presentation Mode
|
||
open_file.title=Open File
|
||
open_file_label=Open
|
||
print.title=Print
|
||
print_label=Print
|
||
download.title=Download
|
||
download_label=Download
|
||
bookmark.title=Current view (copy or open in new window)
|
||
bookmark_label=Current View
|
||
|
||
# Secondary toolbar and context menu
|
||
tools.title=Tools
|
||
tools_label=Tools
|
||
first_page.title=Go to First Page
|
||
first_page.label=Go to First Page
|
||
first_page_label=Go to First Page
|
||
last_page.title=Go to Last Page
|
||
last_page.label=Go to Last Page
|
||
last_page_label=Go to Last Page
|
||
page_rotate_cw.title=Rotate Clockwise
|
||
page_rotate_cw.label=Rotate Clockwise
|
||
page_rotate_cw_label=Rotate Clockwise
|
||
page_rotate_ccw.title=Rotate Counterclockwise
|
||
page_rotate_ccw.label=Rotate Counterclockwise
|
||
page_rotate_ccw_label=Rotate Counterclockwise
|
||
|
||
cursor_text_select_tool.title=Enable Text Selection Tool
|
||
cursor_text_select_tool_label=Text Selection Tool
|
||
cursor_hand_tool.title=Enable Hand Tool
|
||
cursor_hand_tool_label=Hand Tool
|
||
|
||
scroll_vertical.title=Use Vertical Scrolling
|
||
scroll_vertical_label=Vertical Scrolling
|
||
scroll_horizontal.title=Use Horizontal Scrolling
|
||
scroll_horizontal_label=Horizontal Scrolling
|
||
scroll_wrapped.title=Use Wrapped Scrolling
|
||
scroll_wrapped_label=Wrapped Scrolling
|
||
|
||
spread_none.title=Do not join page spreads
|
||
spread_none_label=No Spreads
|
||
spread_odd.title=Join page spreads starting with odd-numbered pages
|
||
spread_odd_label=Odd Spreads
|
||
spread_even.title=Join page spreads starting with even-numbered pages
|
||
spread_even_label=Even Spreads
|
||
|
||
# Document properties dialog box
|
||
document_properties.title=Document Properties…
|
||
document_properties_label=Document Properties…
|
||
document_properties_file_name=File name:
|
||
document_properties_file_size=File size:
|
||
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
|
||
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
|
||
document_properties_kb={{size_kb}} KB ({{size_b}} bytes)
|
||
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
|
||
# will be replaced by the PDF file size in megabytes, respectively in bytes.
|
||
document_properties_mb={{size_mb}} MB ({{size_b}} bytes)
|
||
document_properties_title=Title:
|
||
document_properties_author=Author:
|
||
document_properties_subject=Subject:
|
||
document_properties_keywords=Keywords:
|
||
document_properties_creation_date=Creation Date:
|
||
document_properties_modification_date=Modification Date:
|
||
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
|
||
# will be replaced by the creation/modification date, and time, of the PDF file.
|
||
document_properties_date_string={{date}}, {{time}}
|
||
document_properties_creator=Creator:
|
||
document_properties_producer=PDF Producer:
|
||
document_properties_version=PDF Version:
|
||
document_properties_page_count=Page Count:
|
||
document_properties_page_size=Page Size:
|
||
document_properties_page_size_unit_inches=in
|
||
document_properties_page_size_unit_millimeters=mm
|
||
document_properties_page_size_orientation_portrait=portrait
|
||
document_properties_page_size_orientation_landscape=landscape
|
||
document_properties_page_size_name_a3=A3
|
||
document_properties_page_size_name_a4=A4
|
||
document_properties_page_size_name_letter=Letter
|
||
document_properties_page_size_name_legal=Legal
|
||
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
|
||
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
|
||
# the size, respectively their unit of measurement and orientation, of the (current) page.
|
||
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}} ({{orientation}})
|
||
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
|
||
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
|
||
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
|
||
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})
|
||
# LOCALIZATION NOTE (document_properties_linearized): The linearization status of
|
||
# the document; usually called "Fast Web View" in English locales of Adobe software.
|
||
document_properties_linearized=Fast Web View:
|
||
document_properties_linearized_yes=Yes
|
||
document_properties_linearized_no=No
|
||
document_properties_close=Close
|
||
|
||
print_progress_message=Preparing document for printing…
|
||
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
|
||
# a numerical per cent value.
|
||
print_progress_percent={{progress}}%
|
||
print_progress_close=Cancel
|
||
|
||
# Tooltips and alt text for side panel toolbar buttons
|
||
# (the _label strings are alt text for the buttons, the .title strings are
|
||
# tooltips)
|
||
toggle_sidebar.title=Toggle Sidebar
|
||
toggle_sidebar_notification2.title=Toggle Sidebar (document contains outline/attachments/layers)
|
||
toggle_sidebar_label=Toggle Sidebar
|
||
document_outline.title=Show Document Outline (double-click to expand/collapse all items)
|
||
document_outline_label=Document Outline
|
||
attachments.title=Show Attachments
|
||
attachments_label=Attachments
|
||
layers.title=Show Layers (double-click to reset all layers to the default state)
|
||
layers_label=Layers
|
||
thumbs.title=Show Thumbnails
|
||
thumbs_label=Thumbnails
|
||
current_outline_item.title=Find Current Outline Item
|
||
current_outline_item_label=Current Outline Item
|
||
findbar.title=Find in Document
|
||
findbar_label=Find
|
||
|
||
additional_layers=Additional Layers
|
||
# LOCALIZATION NOTE (page_canvas): "{{page}}" will be replaced by the page number.
|
||
page_canvas=Page {{page}}
|
||
# Thumbnails panel item (tooltip and alt text for images)
|
||
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
|
||
# number.
|
||
thumb_page_title=Page {{page}}
|
||
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
|
||
# number.
|
||
thumb_page_canvas=Thumbnail of Page {{page}}
|
||
|
||
# Find panel button title and messages
|
||
find_input.title=Find
|
||
find_input.placeholder=Find in document…
|
||
find_previous.title=Find the previous occurrence of the phrase
|
||
find_previous_label=Previous
|
||
find_next.title=Find the next occurrence of the phrase
|
||
find_next_label=Next
|
||
find_highlight=Highlight all
|
||
find_match_case_label=Match case
|
||
find_entire_word_label=Whole words
|
||
find_reached_top=Reached top of document, continued from bottom
|
||
find_reached_bottom=Reached end of document, continued from top
|
||
# LOCALIZATION NOTE (find_match_count): The supported plural forms are
|
||
# [one|two|few|many|other], with [other] as the default value.
|
||
# "{{current}}" and "{{total}}" will be replaced by a number representing the
|
||
# index of the currently active find result, respectively a number representing
|
||
# the total number of matches in the document.
|
||
find_match_count={[ plural(total) ]}
|
||
find_match_count[one]={{current}} of {{total}} match
|
||
find_match_count[two]={{current}} of {{total}} matches
|
||
find_match_count[few]={{current}} of {{total}} matches
|
||
find_match_count[many]={{current}} of {{total}} matches
|
||
find_match_count[other]={{current}} of {{total}} matches
|
||
# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are
|
||
# [zero|one|two|few|many|other], with [other] as the default value.
|
||
# "{{limit}}" will be replaced by a numerical value.
|
||
find_match_count_limit={[ plural(limit) ]}
|
||
find_match_count_limit[zero]=More than {{limit}} matches
|
||
find_match_count_limit[one]=More than {{limit}} match
|
||
find_match_count_limit[two]=More than {{limit}} matches
|
||
find_match_count_limit[few]=More than {{limit}} matches
|
||
find_match_count_limit[many]=More than {{limit}} matches
|
||
find_match_count_limit[other]=More than {{limit}} matches
|
||
find_not_found=Phrase not found
|
||
|
||
# Error panel labels
|
||
error_more_info=More Information
|
||
error_less_info=Less Information
|
||
error_close=Close
|
||
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
|
||
# replaced by the PDF.JS version and build ID.
|
||
error_version_info=PDF.js v{{version}} (build: {{build}})
|
||
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
|
||
# english string describing the error.
|
||
error_message=Message: {{message}}
|
||
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
|
||
# trace.
|
||
error_stack=Stack: {{stack}}
|
||
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
|
||
error_file=File: {{file}}
|
||
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
|
||
error_line=Line: {{line}}
|
||
rendering_error=An error occurred while rendering the page.
|
||
|
||
# Predefined zoom values
|
||
page_scale_width=Page Width
|
||
page_scale_fit=Page Fit
|
||
page_scale_auto=Automatic Zoom
|
||
page_scale_actual=Actual Size
|
||
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
|
||
# numerical scale value.
|
||
page_scale_percent={{scale}}%
|
||
|
||
# Loading indicator messages
|
||
loading_error_indicator=Error
|
||
loading_error=An error occurred while loading the PDF.
|
||
invalid_file_error=Invalid or corrupted PDF file.
|
||
missing_file_error=Missing PDF file.
|
||
unexpected_response_error=Unexpected server response.
|
||
|
||
# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be
|
||
# replaced by the modification date, and time, of the annotation.
|
||
annotation_date_string={{date}}, {{time}}
|
||
|
||
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
|
||
# "{{type}}" will be replaced with an annotation type from a list defined in
|
||
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
|
||
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
|
||
text_annotation_type.alt=[{{type}} Annotation]
|
||
password_label=Enter the password to open this PDF file.
|
||
password_invalid=Invalid password. Please try again.
|
||
password_ok=OK
|
||
password_cancel=Cancel
|
||
|
||
printing_not_supported=Warning: Printing is not fully supported by this browser.
|
||
printing_not_ready=Warning: The PDF is not fully loaded for printing.
|
||
web_fonts_disabled=Web fonts are disabled: unable to use embedded PDF fonts.
|