|
| 1 | +.. index:: |
| 2 | + single: Polyfill |
| 3 | + single: MessageFormatter |
| 4 | + single: Components; Polyfill |
| 5 | + |
| 6 | +The Symfony Polyfill / Intl MessageFormatter Component |
| 7 | +====================================================== |
| 8 | + |
| 9 | + This component provides a fallback implementation for the ``MessageFormatter`` |
| 10 | + class to users who run PHP versions without the ``intl`` extension. |
| 11 | + |
| 12 | +Installation |
| 13 | +------------ |
| 14 | + |
| 15 | +.. code-block:: terminal |
| 16 | +
|
| 17 | + $ composer require symfony/polyfill-intl-messageformatter |
| 18 | +
|
| 19 | +Alternatively, you can clone the `<https://github.com/symfony/polyfill-intl-messageformatter>`_ repository. |
| 20 | + |
| 21 | +.. include:: /components/require_autoload.rst.inc |
| 22 | + |
| 23 | +Usage |
| 24 | +----- |
| 25 | + |
| 26 | +Once this component is installed in your application, you can use the following |
| 27 | +classes and functions, no matter if the `PHP intl extension`_ is installed or |
| 28 | +not in your server. |
| 29 | + |
| 30 | +Provided Classes |
| 31 | +~~~~~~~~~~~~~~~~ |
| 32 | + |
| 33 | +* :phpclass:`IntlException` |
| 34 | +* :phpclass:`MessageFormatter` |
| 35 | + |
| 36 | +Provided Functions |
| 37 | +~~~~~~~~~~~~~~~~~~ |
| 38 | + |
| 39 | +* :phpfunction:`msgfmt_format_message` |
| 40 | + |
| 41 | +.. seealso:: |
| 42 | + |
| 43 | + Symfony provides more polyfills for other classes and functions related to |
| 44 | + the Intl PHP extension: |
| 45 | + :doc:`polyfill-intl-grapheme </components/polyfill_intl_grapheme>`, |
| 46 | + :doc:`polyfill-intl-idn </components/polyfill_intl_idn>`, |
| 47 | + :doc:`polyfill-intl-icu </components/polyfill_intl_icu>`, |
| 48 | + and :doc:`polyfill-intl-normalizer </components/polyfill_intl_normalizer>`. |
| 49 | + |
| 50 | +.. _`PHP intl extension`: https://secure.php.net/manual/en/book.intl.php |
0 commit comments