Emoji to English 的评价
Emoji to English 作者: szupie
9 条评价
- 评分 5 / 5来自 Ein,1 年前hi I was able to make a bookmarklet to remove repeating emojis
for example if translation is
☺️☺️☺️[ smiling face ][ smiling face ][ smiling face ]
it will become
☺️[ smiling face ]
javascript: (() => {
let elements = document.querySelectorAll(".emoji-to-english-translation");
for(let element of elements) {
let text = element.textContent;
let words = text.split(/[\[\]]+/);
let unique = [];
for(let word of words) {
word = word.trim();
if(word && !unique.includes(word)) {
unique.push(word);
}
}
if(unique.length > 0) {
let newText = "[ " + unique.join(" ] [ ") + " ] ";
element.textContent = newText;
} else {
element.textContent = "";
}
}
let elements2 = document.querySelectorAll(".emoji-to-english-translatable");
for(let element of elements2) {
let text = element.textContent;
let newText = text.replace(/(\p{Emoji})\1+/gu, '$1');
element.textContent = newText;
}
})()
I tested the bookmarklet and it works.
I wonder if you can add this to the code, I'm not a programmer, I just asked bing A.I. to write the bookmarklet so I don't know how to implement it with firefox extension - 评分 4 / 5来自 Firefox 用户 14620180,5 年前
- 评分 4 / 5来自 PERCE-NEIGE,6 年前Great invention! And it gives the icon's translation in the browser language! Great! The only thing I'd like is to able to edit the translation.
- 评分 5 / 5来自 habs,7 年前
- 评分 5 / 5来自 Jan Piotrowski,7 年前After reading a site with a ... strange emoji that I didn't really understand I commented that it would be nice if browser would just add a tooltip with the emoji name.
Well, someone else linked to this extension that does this job perfectly. Thanks for building it! - 评分 5 / 5来自 Firefox 用户 13266151,7 年前Very useful addon, exactly what I was looking for, didn't see any alternatives either so thanks for creating it.
One minor issue: I use the addon in text only mousehover only mode and usually it works just fine but in some cases no tooltip appears, maybe the emoticon is obstructed by other elements z-axis/rendering-wise?
Works: direct url to a tweet
Doesnt work: tweets in tweetdeck
Doesnt work: comments on youtube, example: https://www.youtube.com/watch?v=OyXohnrEXVA&lc=z12ewxnzyoe0fpdpg04cibagpljvyb0b04o
edit: Thanks for the update, dynamic/delayed content loading makes sense and probably applied to all cases I ran into, I understand the performance impact of monitoring all changes, rescan seems like a good trade off for now.
Concerning twitter I suspect I was fooled by their own mouseover and the fact that you do seem to get the unicode when copy pasting. Anyway, if they use images that's their problem, unless many sites do something similarly addressed I wouldn't bother.开发者回应
发布于 7 年前Thanks for your feedback! I have just released a new version that provides a temporary solution to the YouTube comments issue. Once the comments are loaded, you can right-click on the text and manually rescan for emojis.
In case you're interested, the issue you mentioned is caused by two reasons:
1. YouTube does not load comments until after they are scrolled into view, long after this add-on has scanned the page. I don't have a good solution for efficiently listening to all page changes, but will look more into it in the future.
2. Twitter.com discards emojis and replaces them with embedded images. The good thing is that they do include the translation in the mouseover tooltip on twitter.com. On TweetDeck, the emojis are similarly replaced, but without the tooltip. I can see a way of salvaging that information, but it will have to be a site-specific solution. - 评分 4 / 5来自 Gingko,8 年前If you look on this page :
https://en.wikipedia.org/wiki/Emoji
…using your extension with the options of displaying NO text and NO emoji, any emoji still visible for me is passing through.
But of course it depends on what you consider emoji and what you don't consider emoji. Anyway I think your extension would be more useful if any "character" that displays as (colored?) picture would be handled by it, thus likely at least any character coded by a code point in a 0x1f000-0x1fffff range, not only depending on any closed list provided by the Unicode Consortium.
I actually found your extension while looking for something able to completely hide all emojis, willing to solve the problem of someone else who feels "harassed" by the spreading of emojis. Focusing on this idea may also be good reason to use this extension.
About French translations, you will be probably able to find them on the following site:
http://hapax.qc.ca/
… and more precisely in the following file:
http://hapax.qc.ca/ListeDesNoms-7.0(2014-06-22).txt
Of course, other languages have to provide their own set.
Other suggestions by the way :
- The names given by Unicode Consortium are generally given in all uppercases. It would be probably more beautiful and comfortable to have the option to convert them in lowercases, or better in lowercases with at least first letter on uppercase or something even smarter.
- Some contextual menu items could be optionally added for being able to change the behaviour on the fly.
Gingko开发者回应
发布于 8 年前Thanks so much for your suggestions!
I do agree that more glyphs should be included in the translation. I am rewriting the code to recognise all the sequences from this list [1] (which also has translations in many other languages, including French!) and releasing a new version later this week.
Your ideas for custom formatting and contextual menu items are also great. I'll implement them soon.
:D
UPDATE: v2.0 with more comprehensive emoji support has been approved! Localisation support will be added in the next release.
[1]: http://unicode.org/repos/cldr/tags/latest/common/annotations/en.xml - 评分 5 / 5来自 JustBoris,8 年前Sometimes I can't make out what an emoji does. This solves the problem easy and without fuss. That's it. It's glorious!
Today I discovered that there are options; now I don't have to spoil the presentation of the text.