Before we can start using Yii2's localization features, we first need to make sure the intl
PHP extension is installed. This extension is used to provide Yii2 with the majority of the i18n features, including Yii2's message and date formatters. While Yii2 has some built-in fallbacks in case this extension is not installed, it is highly recommended that you install it beforehand.
Many default PHP installations come with the intl
extension built into the PHP package, but many do not. Fortunately, there are several ways to check whether the intl
extension is installed. For those who prefer viewing this information in a web browser, simply create a blank PHP file in your webroot containing the following and scan the output to check whether the intl
extension exists and is enabled:
<?php phpinfo();
If you prefer using the command line, you can run the following command to check whether intl is installed with your PHP instance:
php –m | grep intl
If...