PHPackages                             translatify/translatify - 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. translatify/translatify

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

translatify/translatify
=======================

Tiny English-as-key i18n helper + drop-in editor for FlightPHP/RedBean projects

v0.1.0(1mo ago)012MITPHPPHP &gt;=8.1

Since Jul 8Pushed 1mo agoCompare

[ Source](https://github.com/mfrederico/translatify)[ Packagist](https://packagist.org/packages/translatify/translatify)[ RSS](/packages/translatify-translatify/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

translatify
===========

[](#translatify)

A tiny English-as-key i18n helper + scanner + drop-in editor for FlightPHP / RedBean PHP projects. ~600 lines of code total, designed to be shared across sibling apps via a local Composer path repo.

- **English-as-key**: `` instead of dotted keys
- **Safe gradual rollout**: missing translations fall back to the source string
- **Drop-in admin editor**: a single PHP partial, no JS framework, theme-aware
- **Two CLIs**: scan code for `t()` calls; find candidate strings to wrap
- **Browser companion**: same JSON dictionaries, ~70 lines of JS
- **ICU MessageFormat support** for plurals, gender, select

TL;DR
-----

[](#tldr)

```
// 1. Bootstrap once per request
\Translatify\Translator::register(__DIR__ . '/lang')
    ->setLocale($member->locale ?? 'en')
    ->setFallback('en');

// 2. Wrap strings as you touch them
