This class sets almost all locale settings and makes your life easier by doing so

v0.4.2 2017-01-03 08:47 UTC

This package is auto-updated.

Last update: 2023-01-26 06:01:22 UTC


Latest Stable Version Build Status Scrutinizer Code Quality License



This class is made by unreal4u (Camilo Sperberg). http://unreal4u.com/.

About this class

  • This class will interact with the server to set locale settings
  • It is able to autodetect from the browser which locale you can setup
  • You can also set it to whatever locale you want
  • It will also format numbers and currencies for you
  • It will also format dates and times
  • It also is able to work with timezones

Basic usage

$locale = new unreal4u\localization();
  • Congratulations! You have just printed 3.1415 formatted according to your browser locale settings!
  • Please see documentation folder for more options and advanced usage


This class has support for Composer install. Just add the following section to your composer.json with:

    "require": {
        "unreal4u/localization": "0.3.*@dev"

Now you can instantiate a new localization class by executing:


$localization = new unreal4u\localization();

TODO list

  • Pass PHP_CodeSniffer
  • Implement more tests
  • Print percentage
  • Print other stuff, make it easy to do so

Version History

  • 0.1 :
    • Original class
  • 0.3 :
    • Composer and PSR-0 compatibility
  • 0.4.0:
    • Deleted check for inline PHP >= 5.3
    • Class is now tested with Travis-CI
    • Updated PHPUnit to v4.0
    • Deleted method formatSimpleNumber and formatSimpleCurrency in favor of formatNumber

Contact the author