@@ -613,6 +613,8 @@ Convert Slack short codes to emojis with the ``slack-emoji`` locale::
613613 $transliterator->transliterate('Menus with :green_salad: or :falafel:');
614614 // => 'Menus with π₯ or π§'
615615
616+ .. _string-text-emoji :
617+
616618Universal Emoji Short Codes Transliteration
617619###########################################
618620
@@ -637,6 +639,33 @@ You can convert emojis to short codes with the ``emoji-text`` locale::
637639 $transliterator->transliterate('Breakfast with π₯ or π₯');
638640 // => 'Breakfast with :kiwifruit: or :milk-glass:
639641
642+ Inverse Emoji Transliteration
643+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
644+
645+ .. versionadded :: 7.1
646+
647+ The inverse emoji transliteration was introduced in Symfony 7.1.
648+
649+ Given the textual representation of an emoji, you can reverse it back to get the
650+ actual emoji thanks to the :ref: `emojify filter <reference-twig-filter-emojify >`:
651+
652+ .. code-block :: twig
653+
654+ {{ 'I like :kiwi-fruit:'|emojify }} {# renders: I like π₯ #}
655+ {{ 'I like :kiwi:'|emojify }} {# renders: I like π₯ #}
656+ {{ 'I like :kiwifruit:'|emojify }} {# renders: I like π₯ #}
657+
658+ By default, ``emojify `` uses the :ref: `text catalog <string-text-emoji >`, which
659+ merges the emoji text codes of all services. If you prefer, you can select a
660+ specific catalog to use:
661+
662+ .. code-block :: twig
663+
664+ {{ 'I :green-heart: this'|emojify }} {# renders: I π this #}
665+ {{ ':green_salad: is nice'|emojify('slack') }} {# renders: π₯ is nice #}
666+ {{ 'My :turtle: has no name yet'|emojify('github') }} {# renders: My π’ has no name yet #}
667+ {{ ':kiwi: is a great fruit'|emojify('gitlab') }} {# renders: π₯ is a great fruit #}
668+
640669 Removing Emojis
641670~~~~~~~~~~~~~~~
642671
0 commit comments