Skip to content

Commit 46a9cda

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: [Emoji] Add the text locale [Dotenv] Fix `SYMFONY_DOTENV_PATH` purpose Move some docs from the Choice constraint to the ChoiceType
2 parents 21e3426 + 38b29fa commit 46a9cda

File tree

4 files changed

+54
-36
lines changed

4 files changed

+54
-36
lines changed

configuration.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -954,15 +954,7 @@ path is part of the options you can set in your ``composer.json`` file:
954954
}
955955
}
956956
957-
You can also set the ``SYMFONY_DOTENV_PATH`` environment variable at system
958-
level (e.g. in your web server configuration or in your Dockerfile):
959-
960-
.. code-block:: bash
961-
962-
# .env (or .env.local)
963-
SYMFONY_DOTENV_PATH=my/custom/path/to/.env
964-
965-
Finally, you can directly invoke the ``Dotenv`` class in your
957+
As an alternate option, you can directly invoke the ``Dotenv`` class in your
966958
``bootstrap.php`` file or any other file of your application::
967959

968960
use Symfony\Component\Dotenv\Dotenv;
@@ -975,9 +967,13 @@ the local and environment-specific files (e.g. ``.*.local`` and
975967
:ref:`how to override environment variables <configuration-multiple-env-files>`
976968
to learn more about this.
977969

970+
If you need to know the path to the ``.env`` file that Symfony is using, you can
971+
read the ``SYMFONY_DOTENV_PATH`` environment variable in your application.
972+
978973
.. versionadded:: 7.1
979974

980-
The ``SYMFONY_DOTENV_PATH`` environment variable was introduced in Symfony 7.1.
975+
The ``SYMFONY_DOTENV_PATH`` environment variable was introduced in Symfony
976+
7.1.
981977

982978
.. _configuration-secrets:
983979

reference/constraints/Choice.rst

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -389,29 +389,3 @@ Parameter Description
389389
=============== ==============================================================
390390

391391
.. include:: /reference/constraints/_payload-option.rst.inc
392-
393-
``separator``
394-
~~~~~~~~~~~~~
395-
396-
**type**: ``string`` **default**: ``-------------------``
397-
398-
This option allows you to customize the visual separator shown after the preferred
399-
choices. You can use HTML elements like ``<hr>`` to display a more modern separator,
400-
but you'll also need to set the `separator_html`_ option to ``true``.
401-
402-
.. versionadded:: 7.1
403-
404-
The ``separator`` option was introduced in Symfony 7.1.
405-
406-
``separator_html``
407-
~~~~~~~~~~~~~~~~~~
408-
409-
**type**: ``boolean`` **default**: ``false``
410-
411-
If this option is true, the `separator`_ option will be displayed as HTML instead
412-
of text. This is useful when using HTML elements (e.g. ``<hr>``) as a more modern
413-
visual separator.
414-
415-
.. versionadded:: 7.1
416-
417-
The ``separator_html`` option was introduced in Symfony 7.1.

reference/forms/types/choice.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,32 @@ correct types will be assigned to the model.
202202

203203
.. include:: /reference/forms/types/options/preferred_choices.rst.inc
204204

205+
``separator``
206+
~~~~~~~~~~~~~
207+
208+
**type**: ``string`` **default**: ``-------------------``
209+
210+
This option allows you to customize the visual separator shown after the preferred
211+
choices. You can use HTML elements like ``<hr>`` to display a more modern separator,
212+
but you'll also need to set the `separator_html`_ option to ``true``.
213+
214+
.. versionadded:: 7.1
215+
216+
The ``separator`` option was introduced in Symfony 7.1.
217+
218+
``separator_html``
219+
~~~~~~~~~~~~~~~~~~
220+
221+
**type**: ``boolean`` **default**: ``false``
222+
223+
If this option is true, the `separator`_ option will be displayed as HTML instead
224+
of text. This is useful when using HTML elements (e.g. ``<hr>``) as a more modern
225+
visual separator.
226+
227+
.. versionadded:: 7.1
228+
229+
The ``separator_html`` option was introduced in Symfony 7.1.
230+
205231
Overridden Options
206232
------------------
207233

string.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ textual representation in all languages based on the `Unicode CLDR dataset`_::
561561

562562
The ``EmojiTransliterator`` also provides special locales that convert emojis to
563563
short codes and vice versa in specific platforms, such as GitHub, Gitlab and Slack.
564+
All theses platform are also combined in special locale ``text``.
564565

565566
GitHub Emoji Transliteration
566567
............................
@@ -607,6 +608,27 @@ Convert Slack short codes to emojis with the ``slack-emoji`` locale::
607608
$transliterator->transliterate('Menus with :green_salad: or :falafel:');
608609
// => 'Menus with 🥗 or 🧆'
609610

611+
Text Emoji Transliteration
612+
..........................
613+
614+
If you don't know where short codes come from, you can use the ``text-emoji`` locale.
615+
This locale will convert Github, Gitlab and Slack short codes to emojis::
616+
617+
$transliterator = EmojiTransliterator::create('text-emoji');
618+
// Github short codes
619+
$transliterator->transliterate('Breakfast with :kiwi-fruit: or :milk-glass:');
620+
// Gitlab short codes
621+
$transliterator->transliterate('Breakfast with :kiwi: or :milk:');
622+
// Slack short codes
623+
$transliterator->transliterate('Breakfast with :kiwifruit: or :glass-of-milk:');
624+
// => 'Breakfast with 🥝 or 🥛'
625+
626+
You can convert emojis to short codes with the ``emoji-text`` locale::
627+
628+
$transliterator = EmojiTransliterator::create('emoji-text');
629+
$transliterator->transliterate('Breakfast with 🥝 or 🥛');
630+
// => 'Breakfast with :kiwifruit: or :milk-glass:
631+
610632
Removing Emojis
611633
~~~~~~~~~~~~~~~
612634

0 commit comments

Comments
 (0)