@@ -451,8 +451,6 @@ letter A with ring above"*) or a sequence of two code points (``U+0061`` =
451451    u('Γ₯')->normalize(UnicodeString::NFD); 
452452    u('Γ₯')->normalize(UnicodeString::NFKD); 
453453
454- .. _string-slugger :
455- 
456454Slugger
457455------- 
458456
@@ -488,11 +486,6 @@ another separator as the second argument::
488486    $slug = $slugger->slug('WΓ΄rΔ·Ε‘Ζ₯Ñçè ~~sΓ¨Ε₯tΓ―Γ±ΔΕ‘~~', '/'); 
489487    // $slug = 'Workspace/settings' 
490488
491- .. tip ::
492- 
493-     Combine this slugger with the :ref: `Symfony emoji transliterator  <component-intl-emoji-transliteration >`
494-     to improve the slugs of contents that include emojis (e.g. for URLs).
495- 
496489The slugger transliterates the original string into the Latin script before
497490applying the other transformations. The locale of the original string is
498491detected automatically, but you can define it explicitly::
@@ -526,6 +519,39 @@ the injected slugger is the same as the request locale::
526519        } 
527520    } 
528521
522+ .. _string-slugger-emoji :
523+ 
524+ Slug Emojis
525+ ~~~~~~~~~~~ 
526+ 
527+ .. versionadded :: 6.2 
528+ 
529+     The Emoji transliteration feature was introduced in Symfony 6.2.
530+ 
531+ You can transform any emojis into a textual representation::
532+ 
533+     use Symfony\Component\String\Slugger\AsciiSlugger; 
534+ 
535+     $slugger = new AsciiSlugger(); 
536+     $slugger = $slugger->withEmoji(); 
537+ 
538+     $slug = $slugger->slug('a πΊ, πββ¬, and a π¦ go to ποΈ', '-', 'en'); 
539+     // $slug = 'a-grinning-cat-black-cat-and-a-lion-go-to-national-park'; 
540+ 
541+     $slug = $slugger->slug('un πΊ, πββ¬, et un π¦ vont au ποΈ', '-', 'fr'); 
542+     // $slug = 'un-chat-qui-sourit-chat-noir-et-un-tete-de-lion-vont-au-parc-national'; 
543+ 
544+ If you want to use a specific locale for the emoji, or to use the shorts code
545+ from `github ` or `slack `, use the first argument of ``withEmoji() `` method::
546+ 
547+     use Symfony\Component\String\Slugger\AsciiSlugger; 
548+ 
549+     $slugger = new AsciiSlugger(); 
550+     $slugger = $slugger->withEmoji('github'); // or "en", or "fr", etc. 
551+ 
552+     $slug = $slugger->slug('a πΊ, πββ¬, and a π¦'); 
553+     // $slug = 'a-smiley-cat-black-cat-and-a-lion'; 
554+ 
529555.. _string-inflector :
530556
531557Inflector
0 commit comments