PHPackages                             roelofjan-elsinga/url-language-extractor - 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. roelofjan-elsinga/url-language-extractor

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

roelofjan-elsinga/url-language-extractor
========================================

0.2.1(3y ago)11.4k↓50%[1 PRs](https://github.com/roelofjan-elsinga/url-language-extractor/pulls)MITPHP

Since Aug 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/roelofjan-elsinga/url-language-extractor)[ Packagist](https://packagist.org/packages/roelofjan-elsinga/url-language-extractor)[ RSS](/packages/roelofjan-elsinga-url-language-extractor/feed)WikiDiscussions master Synced 1mo ago

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

URL Language extractor
======================

[](#url-language-extractor)

[![Build status](https://camo.githubusercontent.com/8495d940f756436873c341905ec01ba28ef10aab1ad4699608825c20b9061d44/68747470733a2f2f7472617669732d63692e636f6d2f726f656c6f666a616e2d656c73696e67612f75726c2d6c616e67756167652d657874726163746f722e737667)](https://travis-ci.com/roelofjan-elsinga/url-language-extractor)[![StyleCI Status](https://camo.githubusercontent.com/345b0fa0bcce493d9e1c2ed54107eca18faaebeb0e5f60895d6045a9894173d4/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230353131373637342f736869656c64)](https://github.styleci.io/repos/205117674)[![Code coverage](https://camo.githubusercontent.com/8efabac3c1d289d9bead2268a5b4e217fcaa2ebb0432bed095a73cdb83a90f7f/68747470733a2f2f636f6465636f762e696f2f67682f726f656c6f666a616e2d656c73696e67612f75726c2d6c616e67756167652d657874726163746f722f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/roelofjan-elsinga/url-language-extractor)[![Total Downloads](https://camo.githubusercontent.com/dbfe9adb5dc643a7f12ee68b965848ffd05fed02655f8965b9c3a9ac1660a559/68747470733a2f2f706f7365722e707567782e6f72672f726f656c6f666a616e2d656c73696e67612f75726c2d6c616e67756167652d657874726163746f722f646f776e6c6f616473)](https://packagist.org/packages/roelofjan-elsinga/url-language-extractor)[![Latest Stable Version](https://camo.githubusercontent.com/12ac780fbfe55d4bd92be377cc27a376fe692fd9963cc111fd075bd7e6821afc/68747470733a2f2f706f7365722e707567782e6f72672f726f656c6f666a616e2d656c73696e67612f75726c2d6c616e67756167652d657874726163746f722f762f737461626c65)](https://packagist.org/packages/roelofjan-elsinga/url-language-extractor)[![License](https://camo.githubusercontent.com/3e5ed71f2d2c982a7d884e171774199cea5025248efd01da64d5d14f92dd89ab/68747470733a2f2f706f7365722e707567782e6f72672f726f656c6f666a616e2d656c73696e67612f75726c2d6c616e67756167652d657874726163746f722f6c6963656e7365)](https://packagist.org/packages/roelofjan-elsinga/url-language-extractor)

This package helps you to resolve the language in a URL.

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

[](#requirements)

- php ^7.4 || &gt;=8.0

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

[](#installation)

You can require the package through Composer.

```
composer require roelofjan-elsinga/url-language-extractor
```

Usage
=====

[](#usage)

You can extract the language from the URL by using the following code:

```
$short_code = LanguageExtractor::forUrl('/page/en/content-page')
    ->setAcceptedShortCodes(['en', 'nl', 'es', 'fr'])
    ->extract();

print $short_code; // 'en'
```

Contributing
------------

[](#contributing)

Do you want to contribute to this project? Great! You can contribute by working on the following things:

- Adding additional ways to detect a language from a URL
- Writing tests to detect edge cases
- Filing issues for new features or bugs

Testing
-------

[](#testing)

You can run tests by running `vendor/bin/phpunit` in your terminal.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

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

Every ~357 days

Total

4

Last Release

1383d ago

PHP version history (2 changes)0.1.1PHP ^7.2

0.2.0PHP ^7.4 || &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/2602444740bac106e338fc57a5d16b085ba02a9ca3d714c2106dccccbf97bba2?d=identicon)[roelofjanelsinga](/maintainers/roelofjanelsinga)

---

Top Contributors

[![roelofjan-elsinga](https://avatars.githubusercontent.com/u/9220754?v=4)](https://github.com/roelofjan-elsinga "roelofjan-elsinga (17 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/roelofjan-elsinga-url-language-extractor/health.svg)

```
[![Health](https://phpackages.com/badges/roelofjan-elsinga-url-language-extractor/health.svg)](https://phpackages.com/packages/roelofjan-elsinga-url-language-extractor)
```

###  Alternatives

[ivolo/disposable-email-domains

disposable domains list

1.4k41.5k1](/packages/ivolo-disposable-email-domains)[lampager/lampager

Rapid pagination without using OFFSET

3778.3k5](/packages/lampager-lampager)[indeev/laravel-schedule-calendar

Laravel Schedule Calendar - a package providing developers with a concise and visual representation of scheduled tasks, enabling easy analysis of load distribution throughout the day or week for optimized task scheduling.

557.7k](/packages/indeev-laravel-schedule-calendar)[calderawp/dismissible-notice

Creates a dismissible--via AJAX--admin nag.

151.3k](/packages/calderawp-dismissible-notice)

PHPackages © 2026

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