PHPackages                             kado/kado.locale - 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. kado/kado.locale

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

kado/kado.locale
================

PHP locale library.

1.0.1(4mo ago)031MITPHPPHP &gt;=8.3

Since Mar 24Pushed 4mo agoCompare

[ Source](https://github.com/sweet-andi/kado.locale)[ Packagist](https://packagist.org/packages/kado/kado.locale)[ RSS](/packages/kado-kadolocale/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

Niirrty.Locale
==============

[](#niirrtylocale)

Locale class and some helpers

Installation
------------

[](#installation)

inside `composer.json`:

```
{
   "require": {
      "php": ">=8.3",
      "kado/kado.locale": "^1.0"
   }
}
```

Usage
-----

[](#usage)

If you want to use this package inside you're application include the depending composer autoload.php

### The Locale

[](#the-locale)

Create a new Locale instance

```
use \Kado\Locale\Locale;

Locale::Create(
   // The fallback locale if no other was found
   new Locale( 'de', 'AT', 'UTF-8' ),
   // Check also the URL path for a locale or language part?
   true,
   // These are the names of the parameters, accepted from $_POST, $_GET and $_SESSION
   [ 'locale', 'language', 'lang' ]
)
   ->registerAsGlobalInstance();
```

This creates the new Locale by checking the following places to get the required information

- First The current URL part is checked, if it contains a valid locale string, it is used (you can disable it by setting the 2nd Create parameter to FALSE.
- Next it checks if one of the defined request parameters (3rd parameter) is defined by $\_POST, $\_GET or $\_SESSION
- After that, its checked if the browser sends some information about the preferred locale/language.
- Finally, it is checked if the system gives usable locale information.

If all this methods fail, the declared fallback locale is returned. You can also call it main locale.

Last but not least the created locale is registered as global available Locale instance. It can be accessed from other places by:

```
if ( Locale::HasGlobalInstance() )
{
   $locale = Locale::GetGlobalInstance();
}
else
{
   // Create the locale
   //$locale = Locale::Create( … )->registerAsGlobalInstance();
}
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance76

Regular maintenance activity

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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 ~6 days

Total

2

Last Release

130d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c3d406ad5f42dc4f4a9af3476d667a0c5ff264b109b17e048535804772bce4d?d=identicon)[Sweet Andi](/maintainers/Sweet%20Andi)

---

Top Contributors

[![UniKado](https://avatars.githubusercontent.com/u/6945587?v=4)](https://github.com/UniKado "UniKado (3 commits)")[![sweet-andi](https://avatars.githubusercontent.com/u/270207515?v=4)](https://github.com/sweet-andi "sweet-andi (1 commits)")

### Embed Badge

![Health badge](/badges/kado-kadolocale/health.svg)

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

###  Alternatives

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[renatomarinho/laravel-multi-language

Laravel Multi Language

235.1k](/packages/renatomarinho-laravel-multi-language)

PHPackages © 2026

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