PHPackages                             buddhika/detectlang - 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. buddhika/detectlang

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

buddhika/detectlang
===================

Detect the language name by the given string

v1.1.0(6y ago)06[1 PRs](https://github.com/lsnt4/detectlang/pulls)MITPHPCI failing

Since Mar 14Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/lsnt4/detectlang)[ Packagist](https://packagist.org/packages/buddhika/detectlang)[ RSS](/packages/buddhika-detectlang/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

DetectLang
==========

[](#detectlang)

Detect the language name by the given string

### Usage

[](#usage)

```
composer require buddhika/detectlang

```

```
require_once './vendor/autoload.php';

$detectlang = new \DetectLang\DetectLang();
$detectlang->set_text('Is මේක a sample text?');
```

```
print_r($detectlang->get_language());
```

```
Array
(
    [en] => 0.66666666666667
)

```

```
print_r($detectlang->get_scores());
```

```
Array
(
    [en] => 0.66666666666667
    [si] => 0.33333333333333
)

```

### Aditional Language Support

[](#aditional-language-support)

Language support can be extended by adding them to the `$languages` array in `DetectLang.php`.

### Disclaimer

[](#disclaimer)

This is a fun project! Don't use this either in production environments or in places where the reliability of the results must be much important.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance53

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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 ~0 days

Total

2

Last Release

2255d ago

### Community

Maintainers

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

---

Top Contributors

[![lsnt4](https://avatars.githubusercontent.com/u/2859796?v=4)](https://github.com/lsnt4 "lsnt4 (3 commits)")

### Embed Badge

![Health badge](/badges/buddhika-detectlang/health.svg)

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

PHPackages © 2026

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