PHPackages                             leodido/langcode-conv - 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. leodido/langcode-conv

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

leodido/langcode-conv
=====================

Convert language codes to any available format

v0.3.0(4y ago)752.8k↓50%3[5 issues](https://github.com/leodido/langcode-conv/issues)ISCPHPPHP &gt;=5.4CI failing

Since Jan 9Pushed 4y ago2 watchersCompare

[ Source](https://github.com/leodido/langcode-conv)[ Packagist](https://packagist.org/packages/leodido/langcode-conv)[ GitHub Sponsors](https://github.com/leodido)[ RSS](/packages/leodido-langcode-conv/feed)WikiDiscussions master Synced 1mo ago

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

Language Codes Converter
========================

[](#language-codes-converter)

[![Latest Stable Version](https://camo.githubusercontent.com/76fe053b9dd566a6c0d223085050fcf599cbb915734630e515135b9bc79bfb08/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c656f6469646f2f6c616e67636f64652d636f6e762e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leodido/langcode-conv) [![Build Status](https://camo.githubusercontent.com/dc12cce51803e03f97519539dad4d36f4b6ea4589a96a9b611c6003c43f23c53/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c656f6469646f2f6c616e67636f64652d636f6e762e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/leodido/langcode-conv) [![Coverage](https://camo.githubusercontent.com/00ba8d9ab2d0953c80446f782635958e659328a925d791ef009e3b8dc6580076/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6c656f6469646f2f6c616e67636f64652d636f6e762e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/leodido/langcode-conv)

This library, based on [conversio library](https://github.com/leodido/conversio), is aimed to convert every existing language code to any format you want. No matter which format the input language code is.

Details
-------

[](#details)

The **available output formats** are:

1. `name`

    The international (often english) name of the language
2. `native`

    The language name written in native representation/s
3. `iso639-1`

    The ISO 639-1 (two-letters code) language representation
4. `iso639-2/t`

    The ISO 639-2/T (three-letters code for terminology applications) language representation
5. `iso639-2/b`

    The ISO 639-2/B (three-letters code, for bibliographic applications) language representation
6. `iso639-3`

    The ISO 639-3 (same as ISO 639-2/T except that for the macrolanguages) language representation

Currently **184 languages** are fully supported.

Examples
--------

[](#examples)

First of all you need to create the conversion adapter and its options class.

```
use Conversio\Conversion;
use Conversio\Adapter\LanguageCode;
use Conversio\Adapter\Options\LanguageCode;
// ...
$adapter = new LanguageCode();
$options = new LanguageCodeOptions();
```

Then, you can pass it to the `Conversion` class constructor (from [conversio library](https://github.com/leodido/conversio)):

```
$converter = new Conversion($adapter);
$converter->setAdapterOptions($options);
```

Or, compactly:

```
$converter = new Conversion(['adapter' => $adapter, 'options' => $options]);
```

Finally we need to specify the desired output format (see above the supported formats) of the conversion and perform it.

```
$options->setOutput('native');
// ISO 639-1 => NATIVE
$converter->filter('it'); // italiano
```

Which ouputs, in this case `italiano`.

Have fun, try other language codes (e.g., `vie`, `tam`).

```
// ISO 639-2/T => NATIVE
$converter->filter('vie'); // tiếng việt
$converter->filter('tam'); // தமிழ்
// ISO 639-3 => NATIVE
$converter->filter('yid + 2'); // ייִדיש
// ISO 639-3 => NAME
$options->setOutput('name');
$converter->filter('vie'); // vietnamese
$converter->filter('tam'); // tamil
$converter->filter('yid + 2'); // yiddish
```

Installation
------------

[](#installation)

Add `leodido/langcode-conv` to your `composer.json`.

```
{
   "require": {
       "leodido/langcode-conv": "v0.3.0"
   }
}
```

References
----------

[](#references)

- Language codes and schemes [reference](http://en.wikipedia.org/wiki/Language_code)
- The [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) standard
- The [ISO 639-2](http://en.wikipedia.org/wiki/ISO_639-2) standard
- The [ISO 639-3](http://en.wikipedia.org/wiki/ISO_639-3) standard
- [List](http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) of ISO 639-1 codes
- [List](http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes) of ISO 639-2 codes
- [List](http://en.wikipedia.org/wiki/List_of_ISO_639-3_codes) of ISO 639-3 codes

---

[![Analytics](https://camo.githubusercontent.com/00c1782a2687545fbbb8009f35d302010419587cd522be9ddc62998534c0013a/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d34393635373137362d312f6c616e67636f64652d636f6e76)](https://github.com/igrigorik/ga-beacon)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance6

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95% 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 ~2377 days

Total

2

Last Release

1769d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120051?v=4)[Leo Di Donato](/maintainers/leodido)[@leodido](https://github.com/leodido)

---

Top Contributors

[![leodido](https://avatars.githubusercontent.com/u/120051?v=4)](https://github.com/leodido "leodido (19 commits)")[![BlackbitDevs](https://avatars.githubusercontent.com/u/8749138?v=4)](https://github.com/BlackbitDevs "BlackbitDevs (1 commits)")

---

Tags

conversionhacktoberfestiso639language-codesphpconvertlibraryconversionconverternamenativeiso639-1iso639-2tiso639-2biso639-3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/leodido-langcode-conv/health.svg)

```
[![Health](https://phpackages.com/badges/leodido-langcode-conv/health.svg)](https://phpackages.com/packages/leodido-langcode-conv)
```

###  Alternatives

[iamcal/php-emoji

This is a PHP library for dealing with Emoji, allowing you to convert between various native formats and displaying them using HTML.

1.3k481.1k](/packages/iamcal-php-emoji)[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)[ssnepenthe/color-utils

A PHP library for performing SASS-like color manipulations.

631.1M10](/packages/ssnepenthe-color-utils)[zman/zman

A Jewish date converter and helper.

186.4k](/packages/zman-zman)

PHPackages © 2026

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