Skip to content

Commit 0163c71

Browse files
alamiraultjaviereguiluz
authored andcommitted
[Emoji] Add the gitlab locale
1 parent 309320a commit 0163c71

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

string.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ textual representation in all languages based on the `Unicode CLDR dataset`_::
560560

561561

562562
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.
564564

565565
GitHub Emoji Transliteration
566566
............................
@@ -577,6 +577,21 @@ Convert GitHub short codes to emojis with the ``github-emoji`` locale::
577577
$transliterator->transliterate('Teenage :turtle: really love :pizza:');
578578
// => 'Teenage 🐢 really love 🍕'
579579

580+
Gitlab Emoji Transliteration
581+
............................
582+
583+
Convert Gitlab emojis to short codes with the ``emoji-gitlab`` locale::
584+
585+
$transliterator = EmojiTransliterator::create('emoji-gitlab');
586+
$transliterator->transliterate('Breakfast with 🥝 or 🥛');
587+
// => 'Breakfast with :kiwi: or :milk:'
588+
589+
Convert Gitlab short codes to emojis with the ``gitlab-emoji`` locale::
590+
591+
$transliterator = EmojiTransliterator::create('gitlab-emoji');
592+
$transliterator->transliterate('Breakfast with :kiwi: or :milk:');
593+
// => 'Breakfast with 🥝 or 🥛'
594+
580595
Slack Emoji Transliteration
581596
...........................
582597

@@ -693,7 +708,7 @@ with the slugger to transform any emojis into their textual representation::
693708
// $slug = 'un-chat-qui-sourit-chat-noir-et-un-tete-de-lion-vont-au-parc-national';
694709

695710
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::
711+
from GitHub, Gitlab or Slack, use the first argument of ``withEmoji()`` method::
697712

698713
use Symfony\Component\String\Slugger\AsciiSlugger;
699714

0 commit comments

Comments
 (0)