Google News
logo
Phalcon - Interview Questions
What is Internationalization in Phalcon?
Phalcon is written in C as an extension for PHP. There is a PECL extension that offers internationalization functions to PHP applications called intl. 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 intl extension’s functionality into Phalcon powered applications.
<?php

use Locale;

$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);

// Locale could be something like 'en_GB' or 'en'
echo $locale;

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 :
 
* en-US (English, United States)
* ru-RU (Russian, Russia)
* zh-Hant-TW (Chinese, Traditional Script, Taiwan)
* fr-CA, fr-FR (French for Canada and France respectively)
Advertisement