Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
a1d10b2c
Commit
a1d10b2c
authored
Sep 23, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated guide about i18n and ICU
fixes #2593
parent
426e6c9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
tutorial-i18n.md
docs/guide/tutorial-i18n.md
+25
-5
No files found.
docs/guide/tutorial-i18n.md
View file @
a1d10b2c
...
...
@@ -497,9 +497,29 @@ See the [data formatter section](output-formatter.md) for details.
Setting up your PHP environment <a name="setup-environment"></a>
-------------------------------
TDB
Yii uses the
[
PHP intl extension
](
http://php.net/manual/en/book.intl.php
)
to provide most of its internationalization features
such as the number and date formatting of the
[
[yii\i18n\Formatter
]
] class and the message formatting using
[
[yii\i18n\MessageFormatter
]
].
Both classes provides a fallback implementation that provides basic functionality in case intl is not installed.
This fallback implementation however only works well for sites in english language and even there can not provide the
rich set of features that is avialable with the PHP intl extension, so its installation is highly recommended.
> Note that formatting may differ between different versions of the ICU library compiled with PHP and also based on the fact whether the
> [PHP intl extension](http://php.net/manual/en/book.intl.php) is installed or not. So to ensure your website works with the same output
> in all environments it is recommended to install the PHP intl extension in all environments and verify that the version of the ICU library
> is the same.
The
[
PHP intl extension
](
http://php.net/manual/en/book.intl.php
)
is based on the
[
ICU library
](
http://site.icu-project.org/
)
which
provides the knowledge and formatting rules for all the different locales. According to this fact the formatting of dates and numbers
and also the supported syntax available for message formatting differs between different versions of the ICU library that is compiled with
you PHP binary.
To ensure your website works with the same output in all environments it is recommended to install the PHP intl extension
in all environments and verify that the version of the ICU library compiled with PHP is the same.
To find out which version of ICU is used by PHP you can run the following script, which will give you the PHP and ICU version used.
```
<?php
echo "PHP: " . PHP_VERSION . "\n";
echo "ICU: " . INTL_ICU_VERSION . "\n";
```
We recommend an ICU version greater or equal to version ICU 49 to be able to use all the features described in this document.
One major feature that is missing in Versions below 49 is the
`#`
placeholder in plural rules.
See
<http://site.icu-project.org/download>
for a list of available ICU versions. Note that the version numbering has changed after the
4.
8 release so that the first digits are now merged: the sequence is ICU 4.8, ICU 49, ICU 50.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment