@@ -39,6 +39,7 @@ This component provides the following ICU data:
3939* `Locales `_
4040* `Currencies `_
4141* `Timezones `_
42+ * `Emoji Transliteration `_
4243
4344Language and Script Names
4445~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -359,6 +360,35 @@ to catching the exception, you can also check if a given timezone ID is valid::
359360
360361 $isValidTimezone = Timezones::exists($timezoneId);
361362
363+ .. _component-intl-emoji-transliteration :
364+
365+ Emoji Transliteration
366+ ~~~~~~~~~~~~~~~~~~~~~
367+
368+ .. versionadded :: 6.2
369+
370+ The Empoji transliteration feature was introduced in Symfony 6.2.
371+
372+ The ``EmojiTransliterator `` class provides an utility to translate emojis into
373+ their textual representation in all languages based on the `Unicode CLDR dataset `_::
374+
375+ use Symfony\Component\Intl\Transliterator\EmojiTransliterator;
376+
377+ // describe emojis in English
378+ $transliterator = EmojiTransliterator::create('en');
379+ $transliterator->transliterate('Menus with 🍕 or 🍝');
380+ // => 'Menus with pizza or spaghetti'
381+
382+ // describe emojis in Ukrainian
383+ $transliterator = EmojiTransliterator::create('uk');
384+ $transliterator->transliterate('Menus with 🍕 or 🍝');
385+ // => 'Menus with піца or спагеті'
386+
387+ .. tip ::
388+
389+ Combine this emoji transliterator with the :ref: `Symfony String slugger <string-slugger >`
390+ to improve the slugs of contents that include emojis (e.g. for URLs).
391+
362392Learn more
363393----------
364394
@@ -381,3 +411,4 @@ Learn more
381411.. _`daylight saving time (DST)` : https://en.wikipedia.org/wiki/Daylight_saving_time
382412.. _`ISO 639-1 alpha-2` : https://en.wikipedia.org/wiki/ISO_639-1
383413.. _`ISO 639-2 alpha-3 (2T)` : https://en.wikipedia.org/wiki/ISO_639-2
414+ .. _`Unicode CLDR dataset` : https://github.com/unicode-org/cldr
0 commit comments