-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Localize add-on & add features for menu display #17
Conversation
* add English translation as template * add German translation
Tab to spaces in JS as per editorconfig.
from UnicodeFontHandler, which now solely handles the font/transformation stuff
This reverts commit 6be555e.
Also fixes the issue that the "old" style was not reset when you clicked in the context menu without any selected text.
check Chrome/ium comaptibility here (this workaround should make it work for now)unicodify/src/background/modules/ContextMenu.js Lines 156 to 161 in 6466b50
This comment was generated by todo based on a
|
Oh thanks TODO bot, yeah, @tdulcet you’ve tried that with Chromium. I guess for now it’s okay, if it works without errors. (Likely the second feature won’t be possible to be made to work, because Chrome/ium has no |
bf6b9b0
to
cb5485a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry to make such a big PR, but I exaggerated a little as I just implemented two new features too:
- you can show the description of the transformation without the applied transformation (as it may be hardly readable)
- you can show the selected text itself as a "live preview" instead of a static string for each entry 🙂
- you can combine these two
Wow, thank you for adding these features! The "live preview" feature is cool.
Oh thanks TODO bot, yeah, @tdulcet you’ve tried that with Chromium. I guess for now it’s okay, if it works without errors. (Likely the second feature won’t be possible to be made to work, because Chrome/ium has no
browser.menu.onShown
callback (API).
I just tested this PR in Chrome and it does work without errors. You do need to temporally remove the icons from the manifest.json
file to load it, as unlike Firefox, Chrome does not let users load extensions if any of the files do not exist. You also have to manually set the settings in the common/modules/data/DefaultSettings.js
file until rugk/awesome-emoji-picker#4 (comment) is fixed (or make the change noted in that comment).
Overall, this PR looks very good! I only found a few minor issues. There are also some ESLint errors, which I did not mention in my review, including several additional ones after fixing this.
<input class="setting save-on-change" type="checkbox" id="livePreview" data-optiongroup="unicodeFont" name="livePreview"> | ||
<label data-i18n="__MSG_optionMenuShowLivePreview__" for="livePreview">Show a live preview with the selected text</label> | ||
</div> | ||
<span data-i18n="__MSG_optionMenuShowLivePreviewDescr__" class="line indent helper-text">Shows the effect of the transformation on the selected text instead of an example one.</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a note that this is only for Firefox/Thunderbird.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd rather think of conditionally disabling it like the isMobile
/ MobileHelper
(or how it was called) does.
However, I did not want to put work into it yet, but it's definitively a thing that should be done before a Chrome/ium release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, for now I've adjusted the AutomaticSettings
to just handle it the same as mobile-incompatible settings and hide them. May be changed later though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating your library. Note that the change will hide the option for Thunderbird, in addition to Chrome. This line:
https://github.com/TinyWebEx/AutomaticSettings/blob/f67aef00fed936456f009f29a7518d6b38056c78/EnvironmentalOptions.js#L36
would need to be:
return browserInfo.name === "Firefox" || browserInfo.name === "Thunderbird";
although maybe also rename the function to something like isMozilla
or isGecko
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now, though I used the vendor name…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug that a superflous separator could have been added at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good to me! Thanks again for doing this.
There was a problem hiding this 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! Feel free to merge this whenever you are ready.
Supersedes #5
I reverted some of the last commits (i.e. did not use them in this branch) and cleaned up the code afterwards.
See the commits for for information.
BTW here is a code snipping one can paste into the debug console to get the transformed entries of the translated versions of the transformation names:
We may document that in the wiki or so. It helped me to update the German version, because it names some examples in the docu, this way, they are easy to get.
I'm sorry to make such a big PR, but I exaggerated a little as I just implemented two new features too: