PHPackages                             crodas/intl - 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. crodas/intl

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

crodas/intl
===========

easy internationalization support for PHP

01901PHP

Since Aug 29Pushed 11y ago1 watchersCompare

[ Source](https://github.com/crodas/intl)[ Packagist](https://packagist.org/packages/crodas/intl)[ RSS](/packages/crodas-intl/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

crodas/intl
===========

[](#crodasintl)

Easy internationalization support for PHP

It aims to be a drop-in replacement for `gettext`.

Setup
-----

[](#setup)

It can be installed with composer

```
composer require crodas/intl:dev-master
```

Concepts
--------

[](#concepts)

`crodas/intl` at run time provides a few functions (`__`, `_e` and `_` *if gettext in not installed*) to translate text. It also provides a **generator** that walks throughtout the project and extract *all* texts it can find and generates a `template` file.

That `template` needs to be copied in order to create new `locales` or `languages`. You can run this process as many time as you'd like, the `template` file and *all* `locale` files are going to be updated (but we never override its content).

Whenever you update your locale files you would need to **compile** it in order to load efficiently from your PHP app.

TODO: *add demos*

Using
-----

[](#using)

In order to use `crodas/intl`, it needs to be initialized as follows:

```
require "vendor/autoload.php";

crodas\Intl::init("/tmp/language.php", $locale);
```

It takes two arguments, the first is the compiled locale and the second is the language to use.

It is possible to switch to another locale at any time by doing:

```
crodas\Intl::setLanguage($locale);
```

Then you can call to `__("Hello")` and `__("Hello %s, welcome")`, they will be replaced with the correct locale or the default content will be print if we can't the locale file or the sentence to translate, pretty much like `gettext` works.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

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/36463?v=4)[C](/maintainers/crodas)[@crodas](https://github.com/crodas)

---

Top Contributors

[![crodas](https://avatars.githubusercontent.com/u/36463?v=4)](https://github.com/crodas "crodas (10 commits)")

### Embed Badge

![Health badge](/badges/crodas-intl/health.svg)

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

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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