PHPackages                             mberatsanli/multilangphp - 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. mberatsanli/multilangphp

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

mberatsanli/multilangphp
========================

Multilang is a language translator library

v2.0.2(6y ago)7242MITPHPPHP &gt;=7.0

Since Dec 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mberatsanli/multilangPHP)[ Packagist](https://packagist.org/packages/mberatsanli/multilangphp)[ Docs](https://github.com/mberatsanli/multilangPHP)[ RSS](/packages/mberatsanli-multilangphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (2)Used By (0)

multilangPHP v2.0.1
===================

[](#multilangphp-v201)

[![MBS-PHP](https://camo.githubusercontent.com/a5a5c31cdd6269a61cb741335f8d2f2eb4c775c21e4908cd57cb0cc7a757e0a3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6d626572617473616e6c692f6d756c74696c616e675048502e737667)](http://mberatsanli.github.io/multilangPHP)[![MBS-PHP](https://camo.githubusercontent.com/8dae3ab3b3f7abc4739e047d992c6606b17f88df84637b91fa2cc7aa01aac1f6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6d626572617473616e6c692f6d756c74696c616e675048502e737667)](http://mberatsanli.github.io/multilangPHP)[![MBS-PHP](https://camo.githubusercontent.com/211c98d62eb4f6c7fa4c22d9e89160f016512f3707d9cec571f8ba571ff03f1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6d626572617473616e6c692f6d756c74696c616e675048502e737667)](http://mberatsanli.github.io/multilangPHP)[![MBS-PHP](https://camo.githubusercontent.com/cbc41e567b8344458ba9e1ad586094c519401aa787146acb7c8286ed1c851dcc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f6d626572617473616e6c692f6d756c74696c616e675048502e737667)](http://mberatsanli.github.io/multilangPHP)[![MBS-PHP](https://camo.githubusercontent.com/877a7e4e845c47ca893dc14228d2e55a9f81dfc14da8497b6623c38117fcab1a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d626572617473616e6c692f6d756c74696c616e675048502e737667)](http://mberatsanli.github.io/multilangPHP)

[![MBS-master](https://camo.githubusercontent.com/f8d5a3812c97148b07d3afc5511aeee93c12f480005ca4a893e1f55293aaa0af/68747470733a2f2f6170692e7472617669732d63692e6f72672f6d626572617473616e6c692f6d756c74696c616e675048502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mberatsanli/multilangPHP/jobs/522465502)[![MBS-quality](https://camo.githubusercontent.com/f3ef635db3185ee6a2b635dd7549616dd02d5171414c96b4f34e8e07551c1a33/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d626572617473616e6c692f6d756c74696c616e675048502f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://camo.githubusercontent.com/f3ef635db3185ee6a2b635dd7549616dd02d5171414c96b4f34e8e07551c1a33/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d626572617473616e6c692f6d756c74696c616e675048502f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)[![MBS-intelligence](https://camo.githubusercontent.com/8f71ccfd6dc68318b8924d04f3228c6377f925277018b00a3f723dfc452299b6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d626572617473616e6c692f6d756c74696c616e675048502f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/g/mberatsanli/multilangPHP/)

### Import the library

[](#import-the-library)

```
require_once("lib/multilang.php");
```

Using
-----

[](#using)

#### &gt; How to starting

[](#-how-to-starting)

```
multilang::setup();
```

#### &gt; Set Languages Directory

[](#-set-languages-directory)

```
multilang::set("dir", "../demo/langs/");
```

before `mutlilang::setup();`

#### &gt; GET function

[](#-get-function)

```
multilang::get($req, $return);
```

$returnwhat is does1return0echo$requestwhat is doesoutput examplelangGives you the language selected by the userendirGives you the directory../demo/langs/logGives the log of the libraryarray()log\_lastGives the last log the libraryThe current language is set trdir&amp;langGives the language file directory selected by the user../demo/langs/tr.php#### &gt; List the language in the defined direcory

[](#-list-the-language-in-the-defined-direcory)

```
echo multilang::listlang($returnType);
```

$returnTypewhat is doesoutputhtmlGives languages in html formatdiv.multilang &gt; \[a href="?lang=tr" title="language tr"\]tr\[/a\]arrayGives languages in arrayarray('tr' =&gt; 'tr.php')#### &gt; How to create the language file

[](#-how-to-create-the-language-file)

For example, the folder with the language files: `../demo/langs/` and we create a language folder in the directory. Create `LANGUAGE.php` for example `az.php`

```
// '../demo/langs/az.php'

$LANG = array(); // We are creating an array called LANG

$LANG['test'] = "Bu bir testdir.";

$LANG['CALLED_NAME'] = "CONTENTS";
```

#### &gt; How to get the text

[](#-how-to-get-the-text)

```
echo multilang::lang($type);
```

$type is a CALLED NAME

```
// Example
echo multilang::lang('test'); // Output (return): Bu bir testtir.
```

Example Using
-------------

[](#example-using)

```
// index.php
require_once("lib/multilang.php");

multilang::set("dir", "langs/"); // We defined the language directory
multilang::setup(); // We starting the library

echo multilang::lang("test"); // Echo the text

print_r(multilang::get("log", 1)); // Print the log array
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

Unknown

Total

1

Last Release

2332d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3e5fcb9f3294e648a54c674daf3d1a54d4d79b14b32409601fc821a45d56fb4?d=identicon)[mberatsanli](/maintainers/mberatsanli)

---

Top Contributors

[![mberatsanli](https://avatars.githubusercontent.com/u/15654470?v=4)](https://github.com/mberatsanli "mberatsanli (24 commits)")

---

Tags

languagesmultilangmultilanguagephpphp-libraryphptranslatormultilangmultilangphpmberatsanli

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mberatsanli-multilangphp/health.svg)

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

###  Alternatives

[stichoza/google-translate-php

Free Google Translate API PHP Package

2.0k7.6M124](/packages/stichoza-google-translate-php)[gettext/translator

Gettext translator functions

114.6M10](/packages/gettext-translator)[jrmajor/fluent

Fluent localization system for PHP

2716.9k5](/packages/jrmajor-fluent)

PHPackages © 2026

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