This class is made by unreal4u (Camilo Sperberg). http://unreal4u.com/.
- 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
include('src/unreal4u/localization.class.php'); $locale = new unreal4u\localization(); $locale->autodetectLocale(); $locale->formatNumber(3.1415);
- 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:
require('vendor/autoload.php'); $localization = new unreal4u\localization();
- Pass PHP_CodeSniffer
- Implement more tests
- Print percentage
- Print other stuff, make it easy to do so
- 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
- Twitter: @unreal4u
- Website: http://unreal4u.com/
- Github: http://www.github.com/unreal4u