Internationalization


    Phalcon is written in C as an extension for PHP. There is a PECL extension that offers internationalization functions to PHP applications called . Its documentation can be found in the pages of the official PHP manual.

    Phalcon does not offer this functionality, since creating such a component would be replicating existing code.

    In the examples below, we will show you how to implement the extension’s functionality into Phalcon powered applications.

    There are several ways to find out the best available locale using intl. One of them is to check the HTTP header:

    Below method returns a locale identified. It is used to get language, culture, or regionally-specific behavior from the Locale API.

    Examples of identifiers include:

    • (Russian, Russia)
    • zh-Hant-TW (Chinese, Traditional Script, Taiwan)

    Printing numbers formatted based on some locale:

    Message formatting using time and date patterns:

    The class provides string comparison capability with support for appropriate locale-sensitive sort orderings. Check the examples below on the usage of this class: