@@ -561,6 +561,7 @@ textual representation in all languages based on the `Unicode CLDR dataset`_::
561
561
562
562
The ``EmojiTransliterator `` also provides special locales that convert emojis to
563
563
short codes and vice versa in specific platforms, such as GitHub, Gitlab and Slack.
564
+ All theses platform are also combined in special locale ``text ``.
564
565
565
566
GitHub Emoji Transliteration
566
567
............................
@@ -607,6 +608,27 @@ Convert Slack short codes to emojis with the ``slack-emoji`` locale::
607
608
$transliterator->transliterate('Menus with :green_salad: or :falafel:');
608
609
// => 'Menus with 🥗 or 🧆'
609
610
611
+ Text Emoji Transliteration
612
+ ..........................
613
+
614
+ If you don't know where short codes come from, you can use the ``text-emoji `` locale.
615
+ This locale will convert Github, Gitlab and Slack short codes to emojis::
616
+
617
+ $transliterator = EmojiTransliterator::create('text-emoji');
618
+ // Github short codes
619
+ $transliterator->transliterate('Breakfast with :kiwi-fruit: or :milk-glass:');
620
+ // Gitlab short codes
621
+ $transliterator->transliterate('Breakfast with :kiwi: or :milk:');
622
+ // Slack short codes
623
+ $transliterator->transliterate('Breakfast with :kiwifruit: or :glass-of-milk:');
624
+ // => 'Breakfast with 🥝 or 🥛'
625
+
626
+ You can convert emojis to short codes with the ``emoji-text `` locale::
627
+
628
+ $transliterator = EmojiTransliterator::create('emoji-text');
629
+ $transliterator->transliterate('Breakfast with 🥝 or 🥛');
630
+ // => 'Breakfast with :kiwifruit: or :milk-glass:
631
+
610
632
Removing Emojis
611
633
~~~~~~~~~~~~~~~
612
634
0 commit comments