Phalcon is written in C as an extension for PHP. There is a PECL (PHP Extension Community Library) extension that offers internationalization functions to PHP applications called intl. In PHP 5.4/5.5 this extension is bundled with PHP. Its documentation can be found in the pages of the official PHP manual.
There are several ways to find out the best available locale using intl. One of them is to check the HTTP Accept-Language header:
Examples of identifiers include: