PHPackages                             phact-cmf-modules/lang - 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. phact-cmf-modules/lang

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

phact-cmf-modules/lang
======================

Lang module for phact CMF

v2.0.1(7y ago)06721MITPHPPHP ^7.1.3

Since Sep 24Pushed 7y agoCompare

[ Source](https://github.com/phact-cmf-modules/Lang)[ Packagist](https://packagist.org/packages/phact-cmf-modules/lang)[ Docs](https://github.com/phact-cmf-modules/Lang)[ RSS](/packages/phact-cmf-modules-lang/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

Мультиязычность для TextField и CharField
=========================================

[](#мультиязычность-для-textfield-и-charfield)

Краткое описание
----------------

[](#краткое-описание)

Добавляет возможность описывать многоязычные поля CharField, TextField.

LangCharField, LangTextField являются виртуальными полями, которые в свою очередь создают реальные поля в модели с постфиксами вида "\_ru", "\_en", соответствующие языкам. Языки описываются для компонента.

Пример использования
--------------------

[](#пример-использования)

### Пример описания компонента

[](#пример-описания-компонента)

```
'lang' => [
    'class' => \Modules\Lang\Components\Lang::class,
    'langs' => ['ru', 'en'],
    'primaryLang' => 'ru'
],
```

### Пример описания поля

[](#пример-описания-поля)

```
...
'name' => [
    'class' => LangCharField::class,
    'label' => 'Name',
    'primaryNull' => true,
    'secondaryNull' => true
],
...
```

### Перебрать все поля, созданные в модели

[](#перебрать-все-поля-созданные-в-модели)

```
$nameField = $model->getField('name');
foreach ($nameField->getFieldsNames() as $name) {
    $model->{$name} = "";
}
```

### Вывод в шаблоне / коде значения поля с текущим языком

[](#вывод-в-шаблоне--коде-значения-поля-с-текущим-языком)

```
$model->name
```

```
{$model->name}
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

3

Last Release

2712d ago

Major Versions

v1.0.0 → v2.0.02019-01-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/324fc1713367ed6c64d63e6ad760b2603c7e231be26f726f034eff98595c4744?d=identicon)[AntonOkulov](/maintainers/AntonOkulov)

---

Top Contributors

[![AntonOkulov](https://avatars.githubusercontent.com/u/34657149?v=4)](https://github.com/AntonOkulov "AntonOkulov (5 commits)")

### Embed Badge

![Health badge](/badges/phact-cmf-modules-lang/health.svg)

```
[![Health](https://phpackages.com/badges/phact-cmf-modules-lang/health.svg)](https://phpackages.com/packages/phact-cmf-modules-lang)
```

###  Alternatives

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