Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain double-click behaviour on tool tip #7717

Merged
merged 1 commit into from
Oct 18, 2016

Conversation

jeenuv
Copy link
Contributor

@jeenuv jeenuv commented Oct 13, 2016

The outline toggle button has a feature where it can be double-clicked
to expand/collapse all items shown therein. Although this is described
in the FAQ, can go potentially unnoticed. This, however, being a useful
feature, advertise on the tool tip itself.

l10n translations are untouched.

Signed-off-by: Jeenu Viswambharan [email protected]

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 13, 2016

The localization logic will override this, so this change is incomplete. Instead, you need to edit https://github.com/mozilla/pdf.js/blob/master/l10n/en-US/viewer.properties#L102 and change that to Show Document Outline (double-click to expand/collapse all) and use this same string at 8978064#diff-a72ef320c3225c98b2163b89a3e8ff62R84 as well.

Fixes #7713.

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 13, 2016

We might need to change the L10n ID (from outline to document_outline for example) to make the localization teams aware of the change, but I'm not sure if that is actally required.

/cc @yurydelendik @Snuffleupagus What do you think?

@jeenuv
Copy link
Contributor Author

jeenuv commented Oct 13, 2016

@timvandermeij That's what I did on a local version of this patch, but then I read in contribution guide:

Note that the translations for PDF.js in the l10n folder are synchronized with the Aurora branch of Mozilla Firefox. This means that we will only accept pull requests that add strings currently missing in the Aurora branch (as it will take at least six weeks before the most recent translations are in the Aurora branch), but keep in mind that the changes will be overwritten when we synchronize again.

My reading was that the patch won't be accepted as it'd be overwritten anyway. I'm happy to push that version instead. What do you think?

@Snuffleupagus
Copy link
Collaborator

Snuffleupagus commented Oct 13, 2016

We might need to change the L10n ID to make the localization teams aware of the change, but I'm not sure if that is actually required.

As explained in https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices#Changing_existing_strings, you _must always_ update the l10n id when changing strings, since otherwise the tools used by localizers may not pick up the change!

[...] and change that to Show Document Outline (double-click to expand/collapse all)

Provided that we actually want to change the tooltip unconditionally like this PR suggest, I'm not really sure about the wording used here.
It seems to me that there's something missing after all, perhaps it should be [...] all items), since it doesn't feel entirely clear what's actually being expanded/collapsed otherwise (e.g. is it the outline itself?).

@timvandermeij
Copy link
Contributor

I agree with the [...] all items change.

@jeenuv Everything except for the en-US file will be synchronized. We only make changes in the English file and upstream takes care of the other translations that we periodically import.

@jeenuv jeenuv force-pushed the display-double-click-tooltip branch 2 times, most recently from a010c53 to 6e51163 Compare October 13, 2016 18:51
@jeenuv
Copy link
Contributor Author

jeenuv commented Oct 13, 2016

I've updated the PR. Please check.

@timvandermeij
Copy link
Contributor

timvandermeij commented Oct 13, 2016

This looks better, but we need to change outline.title and outline_label to document_outline.title and document_outline_label, respectively. This ID must change to make sure that the localization teams know that they have to update the translation of this string. You need to change this in the en-US locale file and in viewer.html (the data-l10n-id locations).

@jeenuv jeenuv force-pushed the display-double-click-tooltip branch from 6e51163 to 1b53510 Compare October 13, 2016 20:22
@@ -99,8 +99,8 @@ print_progress_close=Cancel
# tooltips)
toggle_sidebar.title=Toggle Sidebar
toggle_sidebar_label=Toggle Sidebar
outline.title=Show Document Outline
outline_label=Document Outline
document_outline_label=Show Document Outline (double-click to expand/collapse all items)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label and title IDs must be swapped, i.e., this should be the title, just like before.

@@ -81,8 +81,8 @@
<button id="viewThumbnail" class="toolbarButton group toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs">
<span data-l10n-id="thumbs_label">Thumbnails</span>
</button>
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline" tabindex="3" data-l10n-id="outline">
<span data-l10n-id="outline_label">Document Outline</span>
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="outline">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The data-l10n-id in this line should also be document_outline.

<button id="viewOutline" class="toolbarButton group" title="Show Document Outline" tabindex="3" data-l10n-id="outline">
<span data-l10n-id="outline_label">Document Outline</span>
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="outline">
<span data-l10n-id="document_outline.title">Document Outline</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The label ID must be used here, just like before, so this should be document_outline_label.

@jeenuv jeenuv force-pushed the display-double-click-tooltip branch from 1b53510 to 088a071 Compare October 15, 2016 14:42
Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me after this last change.

<button id="viewOutline" class="toolbarButton group" title="Show Document Outline" tabindex="3" data-l10n-id="outline">
<span data-l10n-id="outline_label">Document Outline</span>
<button id="viewOutline" class="toolbarButton group" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline">
<span data-l10n-id="document_outline_label">Outline</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the changes on this line except for the data-l10n-id change. The extra space is not necessary as we indent everything with two spaces and the text should remain the same as in the L10n file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry - that must be my editor!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The word Document has disappeared in this line, so that needs to be put back. Therefore, this line should be:

<span data-l10n-id="document_outline_label">Document Outline</span>

@jeenuv jeenuv force-pushed the display-double-click-tooltip branch from 088a071 to c65175c Compare October 15, 2016 18:33
The outline toggle button has a feature where it can be double-clicked
to expand/collapse all items shown therein. Although this is described
in the FAQ, can go potentially unnoticed. This, however, being a useful
feature, advertise on the tool tip itself.

l10n translation for en-US and IDs updated.

Signed-off-by: Jeenu Viswambharan <[email protected]>
@jeenuv jeenuv force-pushed the display-double-click-tooltip branch from c65175c to f2dcacd Compare October 16, 2016 08:59
@jeenuv
Copy link
Contributor Author

jeenuv commented Oct 16, 2016

Boy, can't I make a proper commit?! Hopefully I get this one right. Thanks for your patience.

@timvandermeij
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/cff023856a665e1/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/cff023856a665e1/output.txt

Total script time: 1.91 mins

Published

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Since this is a change that affects upstream work for translations, could you merge this if you like it as well, @yurydelendik?

@timvandermeij timvandermeij merged commit 6906623 into mozilla:master Oct 18, 2016
@timvandermeij
Copy link
Contributor

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants