PHPackages                             los/losi18n - 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. los/losi18n

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

los/losi18n
===========

I18N middleware providing route and country, region and language lists in all languages

3.0.0(5y ago)244.2k3MITPHPPHP ^7.4 || ^8.0

Since Jun 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Lansoweb/LosI18n)[ Packagist](https://packagist.org/packages/los/losi18n)[ Docs](http://github.com/Lansoweb/LosI18n)[ GitHub Sponsors](https://github.com/Lansoweb)[ RSS](/packages/los-losi18n/feed)WikiDiscussions 3.1.x Synced today

READMEChangelog (3)Dependencies (6)Versions (12)Used By (0)

LosI18n
=======

[](#losi18n)

Introduction
------------

[](#introduction)

This middleware provides list of Languages, Countries and Regions translated to all languages.

Requirements
------------

[](#requirements)

PHP 7.4 | 8.0 and any container-interopt compatible project.

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

[](#installation)

```
composer require los/losi18n

```

Optionally, copy the config file to your project.

I18n Data
---------

[](#i18n-data)

This module needs data from [losi18n-data](http://github.com/LansoWeb/losi18n-data). So you need either to add the module to you project:

### Adding the losi18n-data

[](#adding-the-losi18n-data)

```
composer require los/losi18n-data

```

### File format

[](#file-format)

There are 3 formats: php, json and csv. If you need to import the json file, it's located: vendor/los/losi18n-data/data//languages.json vendor/los/losi18n-data/data//countries.json vendor/los/losi18n-data/data//regions.json

Usage
-----

[](#usage)

### Language list

[](#language-list)

```
$languagesService = $sm->get('losi18n-countries');
// All languages translated to pt_BR
$languages = $countriesService->getAllLanguages('pt_BR');
// All languages in their native names
$languages = $countriesService->getNativeLanguages();
// Brazilian Portuguese in English
$language = $countriesService->getLanguage('pt_BR', 'en);
```

### Country list

[](#country-list)

```
$countriesService = $sm->get('losi18n-countries');
// All officially assigned countries translated to English
$countries = $countriesService->getAllCountries('en');
// All countries translated to English
$countries = $countriesService->getAllCountries('en', false);
// United States translated to Brazilian Portuguese
$country = $countriesService->getCountry('US','pt_BR');
```

### Region list

[](#region-list)

```
$regionsService = $sm->get('losi18n-regions');
$regions = $countriesService->getAllRegions('pt_BR');
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 73.3% 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 ~269 days

Recently: every ~62 days

Total

9

Last Release

1889d ago

Major Versions

1.0.x-dev → 2.0.02016-08-19

2.1.1 → 3.0.02021-05-01

PHP version history (5 changes)1.0.0PHP &gt;=5.5.0

2.0.0PHP ^7.0

2.1.0PHP ^7.2

2.1.1PHP ^7.1

3.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b54dffc1ebcb317a0cf825a781ab6c5f30980e9abd0d0a3f9c68830cb05c014?d=identicon)[Lansoweb](/maintainers/Lansoweb)

---

Top Contributors

[![Lansoweb](https://avatars.githubusercontent.com/u/2109813?v=4)](https://github.com/Lansoweb "Lansoweb (11 commits)")[![mariojrrc](https://avatars.githubusercontent.com/u/9058951?v=4)](https://github.com/mariojrrc "mariojrrc (3 commits)")[![lebaz20](https://avatars.githubusercontent.com/u/5208251?v=4)](https://github.com/lebaz20 "lebaz20 (1 commits)")

---

Tags

i18nlanguagecountrylos

###  Code Quality

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/los-losi18n/health.svg)

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

###  Alternatives

[gettext/languages

gettext languages with plural rules

7832.7M12](/packages/gettext-languages)[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

544664.5k4](/packages/codezero-laravel-localized-routes)[aplus/language

Aplus Framework Language Library

2391.7M15](/packages/aplus-language)[vluzrmos/language-detector

Detect the language for your application using browser preferences, subdomains or route prefixes.

111573.0k3](/packages/vluzrmos-language-detector)[tractorcow/silverstripe-fluent

Simple localisation for Silverstripe

91437.9k29](/packages/tractorcow-silverstripe-fluent)[codezero/laravel-localizer

Automatically detect and set an app locale that matches your visitor's preference.

50404.9k4](/packages/codezero-laravel-localizer)

PHPackages © 2026

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