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. [Utility &amp; Helpers](/categories/utility)
4. /
5. aligurbuz/lingua

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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

v1.07(7y ago)38.0k1PHP

Since Feb 28Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aligurbuz/Lingua)[ Packagist](https://packagist.org/packages/aligurbuz/lingua)[ RSS](/packages/aligurbuz-lingua/feed)WikiDiscussions master Synced 2w 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

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

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

2882d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8428572?v=4)[Ali E. Gurbuz](/maintainers/aligurbuz)[@aligurbuz](https://github.com/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

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

101466.4k45](/packages/friendsoftypo3-content-blocks)[sulu/sulu

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

1.3k1.4M196](/packages/sulu-sulu)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.4M524](/packages/shopware-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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