PHPackages                             alex-kalanis/kw\_langs - 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. alex-kalanis/kw\_langs

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

alex-kalanis/kw\_langs
======================

Langs for accessing translations in KWCMS

v2.0.0(2y ago)05BSD-3-ClausePHPPHP &gt;=7.4.0

Since Aug 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/alex-kalanis/kw_langs)[ Packagist](https://packagist.org/packages/alex-kalanis/kw_langs)[ RSS](/packages/alex-kalanis-kw-langs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (7)Versions (6)Used By (0)

kw\_langs
=========

[](#kw_langs)

[![Build Status](https://github.com/alex-kalanis/kw_langs/actions/workflows/code_checks.yml/badge.svg)](https://github.com/alex-kalanis/kw_langs/actions/workflows/code_checks.yml/badge.svg)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/474afdb6e97b9028622d328d2fa046d7be4555adffcdcda5a7232538d1af281c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65782d6b616c616e69732f6b775f6c616e67732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/alex-kalanis/kw_langs/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/d20bb760f915734e5756ee93fb5ad7b20ddd435f442711c05764c66b7ef76330/68747470733a2f2f706f7365722e707567782e6f72672f616c65782d6b616c616e69732f6b775f6c616e67732f762f737461626c652e7376673f763d31)](https://packagist.org/packages/alex-kalanis/kw_langs)[![Minimum PHP Version](https://camo.githubusercontent.com/0e9ac047546796cfdbe1423d1f4d91c8f37d2fbb11614a7900bb7686aaa5401f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e342d3838393242462e737667)](https://php.net/)[![Downloads](https://camo.githubusercontent.com/313ea64f894c649233f876f97b8729847bc83a55f008651f4733ae0b5773310b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c65782d6b616c616e69732f6b775f6c616e67732e7376673f7631)](https://packagist.org/packages/alex-kalanis/kw_langs)[![License](https://camo.githubusercontent.com/aa60c58de10c0820de25a8c5513aca49fc6843d54a02958c95d35e19b035dbcd/68747470733a2f2f706f7365722e707567782e6f72672f616c65782d6b616c616e69732f6b775f6c616e67732f6c6963656e73652e7376673f763d31)](https://packagist.org/packages/alex-kalanis/kw_langs)[![Code Coverage](https://camo.githubusercontent.com/36340c3e7069fffa955a4586466c7e0106d1a64ccce2ca55308ff4ac9cb151a5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616c65782d6b616c616e69732f6b775f6c616e67732f6261646765732f636f7665726167652e706e673f623d6d617374657226763d31)](https://scrutinizer-ci.com/g/alex-kalanis/kw_langs/?branch=master)

Define used translations inside the KWCMS tree. Parse them and return them.

PHP Installation
----------------

[](#php-installation)

```
composer.phar require alex-kalanis/kw_langs
```

(Refer to [Composer Documentation](https://github.com/composer/composer/blob/master/doc/00-intro.md#introduction) if you are not familiar with composer)

Package info
------------

[](#package-info)

This package contains example file from KWCMS bootstrap. Use it as reference.

This lang bootstrap is connected with KWCMS modules. Using it outside KWCMS means you need to know the tree structure of module system and positioning langs there.

The idea is about translations which are separated just by their key (in single namespace).

The basic language file itself is simple php file with defined array variable "$lang" in which are stored key-value pairs like in normal php array. You do not need to specify module - it will be automatically set into content array when language loads.

It's also possible to use your own loader which will read your translation files by your own rules. So you can connect reading translations from get\_text module files and that all will still behave the same way. Just it's need to respect that loader's input is module and lang name and output is array of key-value pairs which will be set into translation array. Beware! Previously set translations can be overwritten!

For your own modules and for staying things separated my advice is to have lang key in form of *"{module\_name}.{key\_itself}"* - with dot as separator and module name as prefix.

#### Example:

[](#example)

For \['your internal system key' =&gt; 'output is %s, on %d'\]

```
print \kalanis\kw_langs\Lang::get('your internal system key', 'first param', 2);
```

And it returns 'output is first param, on 2'

The best usage is inside the translations classes across the other modules - you just fill `Lang::get()` with your keys to your translations. It is possible to make a whole class which returns the wanted translations which will be instance of `ILang`and then pass it into lang loader.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~244 days

Total

5

Last Release

763d ago

Major Versions

v1.1.1 → v2.0.02024-04-08

PHP version history (2 changes)v1.0.0PHP &gt;=7.2.0

v2.0.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/499b0a541b787cdb31412f578c7b94c9790bcbee7de12c65b6101c6ce45ef6f0?d=identicon)[alex-kalanis](/maintainers/alex-kalanis)

---

Top Contributors

[![alex-kalanis](https://avatars.githubusercontent.com/u/59184183?v=4)](https://github.com/alex-kalanis "alex-kalanis (16 commits)")

---

Tags

translationslanguagetranslationlanglangs

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alex-kalanis-kw-langs/health.svg)

```
[![Health](https://phpackages.com/badges/alex-kalanis-kw-langs/health.svg)](https://phpackages.com/packages/alex-kalanis-kw-langs)
```

###  Alternatives

[laravel-lang/common

Easily connect the necessary language packs to the application

1463.1M22](/packages/laravel-lang-common)[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[gettext/languages

gettext languages with plural rules

7530.3M11](/packages/gettext-languages)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)[whitecube/lingua

A PHP language codes converter, from and to the most common formats (ISO, W3C, PHP and human-readable names).

441.2M15](/packages/whitecube-lingua)

PHPackages © 2026

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