* MessageFormatter enhances the message formatter class provided by PHP intl extension.
* MessageFormatter allows formatting messages via [ICU message format](http://userguide.icu-project.org/formatparse/messages)
*
* This class enhances the message formatter class provided by the PHP intl extension.
*
*
* The following enhancements are provided:
* The following enhancements are provided:
*
*
* - Accepts named arguments and mixed numeric and named arguments.
* - It accepts named arguments and mixed numeric and named arguments.
* - Issues no error when an insufficient number of arguments have been provided. Instead, the placeholders will not be
* - Issues no error when an insufficient number of arguments have been provided. Instead, the placeholders will not be
* substituted.
* substituted.
* - Fixes PHP 5.5 weird placeholder replacement in case no arguments are provided at all (https://bugs.php.net/bug.php?id=65920).
* - Fixes PHP 5.5 weird placeholder replacement in case no arguments are provided at all (https://bugs.php.net/bug.php?id=65920).
...
@@ -23,24 +25,18 @@ use yii\base\NotSupportedException;
...
@@ -23,24 +25,18 @@ use yii\base\NotSupportedException;
* However it is highly recommended that you install [PHP intl extension](http://php.net/manual/en/book.intl.php) if you want
* However it is highly recommended that you install [PHP intl extension](http://php.net/manual/en/book.intl.php) if you want
* to use MessageFormatter features.
* to use MessageFormatter features.
*
*
* FallbackMessageFormatter is a fallback implementation for the PHP intl MessageFormatter that is
* The fallback implementation only supports the following message formats:
* used in case PHP intl extension is not installed.
* - plural formatting for english
*
* - select format
* Do not use this class directly. Use [[MessageFormatter]] instead, which will automatically detect
* - simple parameters
* installed version of PHP intl and use the fallback if it is not installed.
* - integer number parameters
*
* It is highly recommended that you install [PHP intl extension](http://php.net/manual/en/book.intl.php) if you want to use
* MessageFormatter features.
*
*
* This implementation only supports to following message formats:
* The fallback implementation does NOT support the ['apostrophe-friendly' syntax](http://www.php.net/manual/en/messageformatter.formatmessage.php).
* - plural formatting for english
* Also messages that are working with the fallback implementation are not necessarily compatible with the
* - select format
* PHP intl MessageFormatter so do not rely on the fallback if you are able to install intl extension somehow.
* - simple parameters
*
*
* The pattern also does NOT support the ['apostrophe-friendly' syntax](http://www.php.net/manual/en/messageformatter.formatmessage.php).
* @property string $errorCode Code of the last error. This property is read-only.
*
* @property string $errorMessage Description of the last error. This property is read-only.
* Messages that can be parsed are also not necessarily compatible with the ICU formatting method so do not expect messages that work without intl installed
* to work with intl
*
*
* @author Alexander Makarov <sam@rmcreative.ru>
* @author Alexander Makarov <sam@rmcreative.ru>
* @author Carsten Brandt <mail@cebe.cc>
* @author Carsten Brandt <mail@cebe.cc>
...
@@ -52,9 +48,9 @@ class MessageFormatter extends Component
...
@@ -52,9 +48,9 @@ class MessageFormatter extends Component