PHPackages                             sokil/php-language - 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. sokil/php-language

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

sokil/php-language
==================

Engine to work with language preferences on site

024PHP

Since Sep 5Pushed 9y ago1 watchersCompare

[ Source](https://github.com/sokil/php-language)[ Packagist](https://packagist.org/packages/sokil/php-language)[ RSS](/packages/sokil-php-language/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

php-language
============

[](#php-language)

Library to work with languages and localization on site. This library able to get prefered language from browser settings and store chosen option to cookie.

Prefered language goes from cookies, or if not specified - from browser. If language not listed in preffered - use default value.

Example of usage:

```
// define supported languages
$language = new \Sokil\Language([
  'uk' => ['caption' => 'Ukraininan', 'locale' => 'uk_UA.UTF-8'],
  'en' => ['caption' => 'English', 'locale' => 'en_UK.UTF-8'],
], 'uk');

echo $language->getLanguage();

// if language chosed from list and must be set as system with writing to cookie
$language->setLanguage('uk');
```

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/902e21ecf6517341b1f2a3c2f93a3eb115396fc6524effaeabc816b481909e64?d=identicon)[sokil](/maintainers/sokil)

---

Top Contributors

[![sokil](https://avatars.githubusercontent.com/u/1829948?v=4)](https://github.com/sokil "sokil (13 commits)")

### Embed Badge

![Health badge](/badges/sokil-php-language/health.svg)

```
[![Health](https://phpackages.com/badges/sokil-php-language/health.svg)](https://phpackages.com/packages/sokil-php-language)
```

###  Alternatives

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[devaslanphp/auto-translate

Auto generate translation JSON files

6627.3k](/packages/devaslanphp-auto-translate)

PHPackages © 2026

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