Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf558ed

Browse files
committed
minor#19736 [Emoji] Add the gitlab locale (alamirault)
This PR was squashed before being merged into the 7.1 branch.Discussion----------[Emoji] Add the gitlab localeFix#19731I didn't added `versionadded` because we have this one: `The emoji component was introduced in Symfony 7.1.`Commits-------0163c71 [Emoji] Add the gitlab locale
2 parents9b73ea3 +0163c71 commitaf558ed

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)

[8]ページ先頭

©2009-2025 Movatter.jp