PHPackages                             unreal4u/localization - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. unreal4u/localization

AbandonedLibrary[Localization &amp; i18n](/categories/localization)

unreal4u/localization
=====================

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

v0.4.2(9y ago)098MITPHPPHP &gt;=5.3.0

Since Oct 4Pushed 9y agoCompare

[ Source](https://github.com/unreal4u/localization)[ Packagist](https://packagist.org/packages/unreal4u/localization)[ RSS](/packages/unreal4u-localization/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (3)Versions (10)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/891d2fedae1db7eb63707b2eda090c0ed0a4647d56250350c30126046dce79c6/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f6c6f63616c697a6174696f6e2f762f737461626c652e706e67)](https://packagist.org/packages/unreal4u/localization)[![Build Status](https://camo.githubusercontent.com/126b4603f1d1d0ea2324a42a278cfa7a9f87b4f0db574fecc066b310cb2a8112/68747470733a2f2f7472617669732d63692e6f72672f756e7265616c34752f6c6f63616c697a6174696f6e2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/unreal4u/localization)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a2a66999662bfa87263c1985b412020cf1bbe9ef81ff25e21b0e1f48cdf7f16c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f756e7265616c34752f6c6f63616c697a6174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f733d35663666613837376161613938316439613465343361656330363833333463363637633332383135)](https://scrutinizer-ci.com/g/unreal4u/localization/)[![License](https://camo.githubusercontent.com/da0831593eb9ba7ef34ddce96ab7bd25a8a0b97e47626dac9e1f17f73d15e199/68747470733a2f2f706f7365722e707567782e6f72672f756e7265616c34752f6c6f63616c697a6174696f6e2f6c6963656e73652e706e67)](https://packagist.org/packages/unreal4u/localization)

localization.class.php
======================

[](#localizationclassphp)

Credits
-------

[](#credits)

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

About this class
----------------

[](#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
-----------

[](#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
--------

[](#composer)

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();
```

TODO list
---------

[](#todo-list)

- Pass PHP\_CodeSniffer
- Implement more tests
- Print percentage
- Print other stuff, make it easy to do so

Version History
---------------

[](#version-history)

- 0.1 :
    - Original class
- 0.3 :
    - Composer and PSR-0 compatibility
- 0.4.0:
    - Deleted check for inline PHP &gt;= 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
------------------

[](#contact-the-author)

- Twitter: [@unreal4u](http://twitter.com/unreal4u)
- Website:
- Github:

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~169 days

Recently: every ~275 days

Total

8

Last Release

3465d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/43792f8b224d7de339a848cd799635fa8e062eea3fb669e3ca7a1d1e2cff756d?d=identicon)[unreal4u](/maintainers/unreal4u)

---

Top Contributors

[![unreal4u](https://avatars.githubusercontent.com/u/194999?v=4)](https://github.com/unreal4u "unreal4u (43 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/unreal4u-localization/health.svg)

```
[![Health](https://phpackages.com/badges/unreal4u-localization/health.svg)](https://phpackages.com/packages/unreal4u-localization)
```

###  Alternatives

[php-translation/translator

Translator services

25224.8k5](/packages/php-translation-translator)[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
