PHPackages                             queiroz/tld-lang - 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. queiroz/tld-lang

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

queiroz/tld-lang
================

TldLang multi domain site language for Laravel 4

117PHP

Since Feb 11Pushed 12y ago1 watchersCompare

[ Source](https://github.com/queiroz/TldLang)[ Packagist](https://packagist.org/packages/queiroz/tld-lang)[ RSS](/packages/queiroz-tld-lang/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

TldLang
=======

[](#tldlang)

Laravel 4 - auto select language based on domain .tld

Installation
============

[](#installation)

Add TldLang to your composer.json file:

```
"require": {
	"queiroz/tld-lang": "dev-master"
}

```

Use composer to install this package.

```
$ composer update

```

Configuration
=============

[](#configuration)

#### Registering the Package

[](#registering-the-package)

register this service provider at the bottom of the $providers array: app.php

```
'Queiroz\TldLang\TldLangServiceProvider'

```

Usage
=====

[](#usage)

#### Basic usage

[](#basic-usage)

Supose you have domain.com (English), domain2.es (Spanish), domain3.fr (French) you can simply change the system language based on this .tlds

```
TldLang::set(array(
	'.com' 	=> 	'en',
	'.es'	=> 	'es',
	'.fr'	=>	'fr'
));

```

and finally initialize

`TldLang::init();`

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/670685?v=4)[Rodrigo Queiroz](/maintainers/queiroz)[@queiroz](https://github.com/queiroz)

---

Top Contributors

[![queiroz](https://avatars.githubusercontent.com/u/670685?v=4)](https://github.com/queiroz "queiroz (15 commits)")

### Embed Badge

![Health badge](/badges/queiroz-tld-lang/health.svg)

```
[![Health](https://phpackages.com/badges/queiroz-tld-lang/health.svg)](https://phpackages.com/packages/queiroz-tld-lang)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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