@@ -560,7 +560,11 @@ textual representation in all languages based on the `Unicode CLDR dataset`_::
560
560
561
561
562
562
The ``EmojiTransliterator `` also provides special locales that convert emojis to
563
- short codes and vice versa in specific platforms, such as GitHub and Slack.
563
+ short codes and vice versa in specific platforms, such as GitHub, Gitlab and Slack.
564
+
565
+ .. versionadded :: 7.1
566
+
567
+ The ``gitlab `` special locale was introduced in Symfony 7.1.
564
568
565
569
GitHub Emoji Transliteration
566
570
............................
@@ -577,6 +581,25 @@ Convert GitHub short codes to emojis with the ``github-emoji`` locale::
577
581
$transliterator->transliterate('Teenage :turtle: really love :pizza:');
578
582
// => 'Teenage 🐢 really love 🍕'
579
583
584
+ Gitlab Emoji Transliteration
585
+ ............................
586
+
587
+ Convert Gitlab emojis to short codes with the ``emoji-gitlab `` locale::
588
+
589
+ $transliterator = EmojiTransliterator::create('emoji-gitlab');
590
+ $transliterator->transliterate('Breakfast with 🥝 or 🥛');
591
+ // => 'Breakfast with :kiwi: or :milk:'
592
+
593
+ Convert Gitlab short codes to emojis with the ``gitlab-emoji `` locale::
594
+
595
+ $transliterator = EmojiTransliterator::create('gitlab-emoji');
596
+ $transliterator->transliterate('Breakfast with :kiwi: or :milk:');
597
+ // => 'Breakfast with 🥝 or 🥛'
598
+
599
+ .. versionadded :: 7.1
600
+
601
+ The ``gitlab `` special locale was introduced in Symfony 7.1.
602
+
580
603
Slack Emoji Transliteration
581
604
...........................
582
605
@@ -693,7 +716,7 @@ with the slugger to transform any emojis into their textual representation::
693
716
// $slug = 'un-chat-qui-sourit-chat-noir-et-un-tete-de-lion-vont-au-parc-national';
694
717
695
718
If you want to use a specific locale for the emoji, or to use the short codes
696
- from GitHub or Slack, use the first argument of ``withEmoji() `` method::
719
+ from GitHub, Gitlab or Slack, use the first argument of ``withEmoji() `` method::
697
720
698
721
use Symfony\Component\String\Slugger\AsciiSlugger;
699
722
@@ -703,6 +726,10 @@ from GitHub or Slack, use the first argument of ``withEmoji()`` method::
703
726
$slug = $slugger->slug('a 😺, 🐈⬛, and a 🦁');
704
727
// $slug = 'a-smiley-cat-black-cat-and-a-lion';
705
728
729
+ .. versionadded :: 7.1
730
+
731
+ The ``gitlab `` special locale was introduced in Symfony 7.1.
732
+
706
733
.. _string-inflector :
707
734
708
735
Inflector
0 commit comments