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(2mo ago)031MITPHPPHP &gt;=8.3

Since Mar 24Pushed 2mo 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 3w 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

38

—

LowBetter than 83% of packages

Maintenance83

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

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

85d 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

[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)
