PHPackages                             aligurbuz/lingua - 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. aligurbuz/lingua

ActiveLibrary

aligurbuz/lingua
================

v1.07(7y ago)38.0k1PHP

Since Feb 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/aligurbuz/Lingua)[ Packagist](https://packagist.org/packages/aligurbuz/lingua)[ RSS](/packages/aligurbuz-lingua/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (8)Used By (1)

Lingua
======

[](#lingua)

Easily integrate and manage your language files.

Introduction:
=============

[](#introduction)

> It is a package that you can extensively manage your language files in the format of yaml. Under this package you can easily include your language files in your application code as defined in the package usage.

Installation:
=============

[](#installation)

```
$ composer require aligurbuz/lingua
```

Usage
=====

[](#usage)

> Include your Composer vendor autoload file and use the Lingua class as follows.

```
require_once '../vendor/autoload.php';
use Lingua\Lingua;
```

### Data Retrieving

[](#data-retrieving)

> Include your Composer vendor autoload file and use the Lingua class as follows.The directory path you will assign to constructor object of the lingua class is the main path to your language files. As long as you do not specify the locale method, the "en" directory is automatically appended to the main path.

```
//it is set to the as "en" value of default locale in the langdir directory.
$lang=(new Lingua('path/to/langDir'));

//It prints all the keys in message.yaml (in that path/to/langDir/en)
echo $lang->get('message');

//it is set to the as fr in the langdir directory.
//It prints all the keys in message.yaml (in that path/to/langDir/fr)
echo $lang->locale('fr')->get('message');

//It prints key called foo in message.yaml (in that path/to/langDir/en)
echo $lang->get('message.foo');

//It prints keys specified in array as parameters in message.yaml (in that path/to/langDir/en)
echo $lang->get('message',['foo','bar']);

//if specified exclude as key in array as parameters in message.yaml (in that path/to/langDir/en)
//In this case, the strings in the exclude array are removed from the called file.
echo $lang->get('message',['exclude'=>['foo']);
```

> Sometimes when you search for a key in a language file you may want to determine if it is also included in a file that is automatically included. If the called key does not exist in the specified file, it will check whether it exists automatically in the included file. In fact, lingua will automatically join the two files here. The key you are looking for will be searched in a single array.

```
//It prints all the keys in message.yaml and default.yaml (in that path/to/langDir/en)
echo $lang->include(['default'])->get('message');

//It prints key that in default.yaml if there is no key specified in message.yaml (in that path/to/langDir/en)
echo $lang->include(['default'])->get('message.foo');
```

> > ###### In addition, in some cases you may want your auto-uploaded files to be in a directory.In this case, you can use the includeDir method and, as you can see,the search array will be included in all files in a directory.
> >
> > [](#in-addition-in-some-cases-you-may-want-your-auto-uploaded-files-to-be-in-a-directoryin-this-case-you-can-use-the-includedir-method-and-as-you-can-seethe-search-array-will-be-included-in-all-files-in-a-directory)

```
//It prints key that in both default.yaml and all files in load directory if there is no key specified in message.yaml (in that path/to/langDir/en)
echo $lang->includeDir(['load'])->include(['default'])->get('message.foo');
```

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~40 days

Total

7

Last Release

2831d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/620f2c382f0cc37f40a867667734260f6aa9a46ab1668e4e7135f42949c43887?d=identicon)[aligurbuz](/maintainers/aligurbuz)

---

Top Contributors

[![aligurbuz](https://avatars.githubusercontent.com/u/8428572?v=4)](https://github.com/aligurbuz "aligurbuz (6 commits)")

### Embed Badge

![Health badge](/badges/aligurbuz-lingua/health.svg)

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

###  Alternatives

[zircote/swagger-php

Generate interactive documentation for your RESTful API using PHP attributes (preferred) or PHPDoc annotations

5.3k132.9M468](/packages/zircote-swagger-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[mglaman/phpstan-drupal

Drupal extension and rules for PHPStan

20729.0M123](/packages/mglaman-phpstan-drupal)

PHPackages © 2026

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