2017 © Pedro Peláez
 

library localization

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

image

unreal4u/localization

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

  • Tuesday, January 3, 2017
  • by unreal4u
  • Repository
  • 1 Watchers
  • 0 Stars
  • 61 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 2 % Grown

The README.md

Latest Stable Version Build Status Scrutinizer Code Quality License, (*1)

localization.class.php

Credits

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

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

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

Composer

This class has support for Composer install. Just add the following section to your composer.json with:, (*3)

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

Now you can instantiate a new localization class by executing:, (*4)

require('vendor/autoload.php');

$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

The Versions

03/01 2017

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-intl *

 

The Development Requires

03/01 2017

v0.4.2

0.4.2.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-intl *

 

The Development Requires

29/04 2014

v0.4.1

0.4.1.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-intl *

 

The Development Requires

15/03 2014

v0.4.0

0.4.0.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-intl *

 

The Development Requires

28/12 2013

v0.3.4

0.3.4.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-intl *

 

The Development Requires

27/12 2013

v0.3.3

0.3.3.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-intl *

 

The Development Requires

04/10 2013

v0.3.2

0.3.2.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

04/10 2013

v0.3.1

0.3.1.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

04/10 2013

dev-composerCompatible

dev-composerCompatible

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

04/10 2013

v0.3

0.3.0.0

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0