PHPackages                             mistralys/application-localization - 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. mistralys/application-localization

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

mistralys/application-localization
==================================

PHP and Javascript localization library.

2.1.2(8mo ago)28.8k↓34.7%[2 issues](https://github.com/Mistralys/application-localization/issues)[1 PRs](https://github.com/Mistralys/application-localization/pulls)7MITPHPPHP ^7.4|^8.0CI passing

Since Oct 8Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/Mistralys/application-localization)[ Packagist](https://packagist.org/packages/mistralys/application-localization)[ RSS](/packages/mistralys-application-localization/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (8)Versions (24)Used By (7)

Application Localization
========================

[](#application-localization)

A PHP and JavaScript localization library that automatically discovers translatable strings in your source files and stores translations in simple INI files. Drop in the built-in editor UI and your team can start translating without touching code.

Features
--------

[](#features)

- **Automatic string discovery** — scans PHP and JavaScript source files for translation function calls
- **Built-in translator UI** — a ready-made editor that integrates into any existing interface
- **Clientside translations** — auto-generated JavaScript include files bring `t()` to the browser
- **Translation context** — optional context strings help translators understand ambiguous texts
- **Countries, locales &amp; currencies** — classes for 19 countries, 18 locales, 10 currencies, and 21 time zones with country-specific formatting
- **Locale alias handling** — automatically normalizes `uk`/`gb` and `en_UK`/`en_GB` mix-ups

> **Scope note:** The included countries, locales, and currencies reflect what is commonly needed in typical european-centric web applications, not a complete i18n universe. See the [full list of supported countries and locales](docs/overview.md).

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

[](#requirements)

- PHP 8.4 or higher
- [Composer](https://getcomposer.org/)

Quick Start
-----------

[](#quick-start)

**1. Install via Composer**

```
composer require mistralys/application-localization
```

**2. Configure the library**

```
use AppLocalize\Localization;

// Register the locales your app supports (english is the native locale)
Localization::addAppLocale('de_DE');
Localization::addAppLocale('fr_FR');

// Register a source folder to scan for translatable strings
Localization::addSourceFolder(
    'my-app',
    'My Application',
    'Core',
    '/path/to/ini/files/',
    '/path/to/source/files/'
);

// Finalize configuration (always last)
Localization::configure('/path/to/cache.json');
```

**3. Translate strings in PHP**

```
use function AppLocalize\t;
use function AppLocalize\pt;

$message = t('Welcome back, %1$s!', $username);
pt('Save changes');
```

**4. Translate strings in JavaScript**

```
var message = t('Welcome back, %1$s!', username);
```

**5. Switch the active locale**

```
Localization::selectAppLocale('de_DE');
```

Learn More
----------

[](#learn-more)

TopicDocumentFull setup walkthrough[Configuration Guide](docs/configuration.md)Translation functions, placeholders &amp; best practices[Translation Functions](docs/translation-functions.md)Countries, currencies &amp; time zones API[Countries, Currencies &amp; Time Zones](docs/countries-currencies-timezones.md)Supported countries, locales &amp; currencies[Supported countries and locales](docs/overview.md)Changelog[changelog.md](changelog.md)Packagist[mistralys/application-localization](https://packagist.org/packages/mistralys/application-localization)Example
-------

[](#example)

Run `composer update` in the package folder and open the `example/` directory in your browser (package must be inside your webserver's document root) to see the editor UI live.

Origins
-------

[](#origins)

This library grew out of several internal applications before being extracted into a standalone package. It makes no claim of replacing established i18n libraries — it simply solves a specific set of localization needs cleanly and pragmatically.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance54

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 99.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 ~122 days

Recently: every ~36 days

Total

19

Last Release

263d ago

Major Versions

1.5.0 → 2.0.02025-05-21

PHP version history (3 changes)1.3.0PHP &gt;=7.3

1.5.0PHP &gt;=7.4

2.0.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8895528?v=4)[Mistralys](/maintainers/Mistralys)[@Mistralys](https://github.com/Mistralys)

---

Top Contributors

[![Mistralys](https://avatars.githubusercontent.com/u/8895528?v=4)](https://github.com/Mistralys "Mistralys (448 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

clientside-javascripti18ninternationalizationlanguagelibrarylocalizationphptranslationtranslator-appuser-interface

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mistralys-application-localization/health.svg)

```
[![Health](https://phpackages.com/badges/mistralys-application-localization/health.svg)](https://phpackages.com/packages/mistralys-application-localization)
```

###  Alternatives

[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M419](/packages/drupal-core-recommended)[wp-cli/i18n-command

Provides internationalization tools for WordPress projects.

11811.6M66](/packages/wp-cli-i18n-command)[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.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

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