emoji-translate
:books: Translate text to ✨emoji ✨!
[ This description is mirrored from README.md at github.com/notwaldorf/emoji-translate on 2019-05-10 ]
emoji-translate
You know how sometimes you type English and it has all these letters and words and no emoji? Yeah, emoji-translate fixes that.
Packaged demos
This is what you actually want, right? Can't blame you. Here you go. �
There's also a Chrome extension that lets you translate any page on the internet to emoji. Your nightmares are finally over.
Emoji-translate as a library
You can also use this as a standalone library for your own translation purposes.
Install
bower install emoji-translate
Usage
When emoji-translate.js
is loaded, it will load json of emoji names and keywords, save it in a global called allEmojis
, and fire an emoji-ready
event. allEmojis
has this structure:
{
"grinning": {
"keywords": ["face", "smile", "happy", "joy"],
"char": "�",
"category": "people"
},
"grin": {
"keywords": ["face", "happy", "smile", "joy"],
"char": "�",
"category": "people"
},
...
}
The emoji-translate
api has 2 methods:
getMeAnEmoji(word)
-- returns the emoji translation of the englishword
, or the empty string if one doesn't exist.translateWord(word)
-- returns a<span>
element that contains either the original englishword
, or the emoji translation, ready for display.
❤
This was made as part of an ⚡️emoji hackday⚡️ and is powered by emojilib, a magical json
file of emoji names and keywords y'all should use in all your projects.
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Dependencies
- emojilib#^2.0.0
- Released
- 2016-11-10
- Maturity
- IMPORTED
- License
- MIT License
Compatibility
- Framework
- Polymer 1.0+
- Browser
- Browser Independent