@@ -561,6 +561,7 @@ textual representation in all languages based on the `Unicode CLDR dataset`_::
561561
562562The ``EmojiTransliterator `` also provides special locales that convert emojis to
563563short codes and vice versa in specific platforms, such as GitHub, Gitlab and Slack.
564+ All theses platform are also combined in special locale ``text ``.
564565
565566GitHub Emoji Transliteration
566567............................
@@ -607,6 +608,27 @@ Convert Slack short codes to emojis with the ``slack-emoji`` locale::
607608 $transliterator->transliterate('Menus with :green_salad: or :falafel:');
608609 // => 'Menus with 🥗 or 🧆'
609610
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+
610632Removing Emojis
611633~~~~~~~~~~~~~~~
612634
0 commit comments