PHPackages                             webtrendi/lexiconic - 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. webtrendi/lexiconic

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

webtrendi/lexiconic
===================

Utility and classes to facilitate gettext style translations in PHP

v1.0.0(12y ago)257MITPHPPHP &gt;=5.3.0

Since Apr 14Pushed 11y ago2 watchersCompare

[ Source](https://github.com/webtrendi/lexiconic)[ Packagist](https://packagist.org/packages/webtrendi/lexiconic)[ RSS](/packages/webtrendi-lexiconic/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Lexiconic
=========

[](#lexiconic)

Utility and classes to facilitate gettext style translations in PHP

Usage
-----

[](#usage)

Example file simple.php:

```
/* detect current language */
if (isset($_GET['locale'])) {
    $locale = $_GET['locale'];
} else {
    $locale = 'en_CA';
} //if

/* setup environment */
putenv("LANG=" . $locale);
putenv("LANGUAGE=" . $locale);
setlocale(LC_ALL, $locale);

/* setup extractor */
$extractor = new \Lexiconic\Extractor\GettextExtractor('application', __DIR__ .'/locale/');

/* get term functions */
$_ = $extractor->getTermFunction();

/* Use string extractor function */
echo $_('Ok this is simple enough'), PHP_EOL;
```

To scan files for terms you would run something like:

```
xgettext --language=PHP \\
  --keyword=_:1 --keyword=_:1,2c \\
  --keyword=_n:1,2 --keyword=_n:1,2,4c \\
  --output=./locale/simple.po  ./simple.php
```

Features
--------

[](#features)

- Supports context in strings
- Abstracts the gettex library to support other methods
- Does not invade global scope

To Do
-----

[](#to-do)

- scripts to extract strings
- scripts to generate mo
- classes to manipulate po files
- implement other extractors
- unit tests
- more examples

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Unknown

Total

1

Last Release

4411d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/792553?v=4)[Patrick Forget](/maintainers/patforg)[@patforg](https://github.com/patforg)

---

Top Contributors

[![patforg](https://avatars.githubusercontent.com/u/792553?v=4)](https://github.com/patforg "patforg (13 commits)")

---

Tags

localizationinternationalizationtranslationgettext

### Embed Badge

![Health badge](/badges/webtrendi-lexiconic/health.svg)

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

###  Alternatives

[tio/laravel

Add this package to localize your Laravel application (PHP, JSON or GetText).

170318.5k](/packages/tio-laravel)[tractorcow/silverstripe-fluent

Simple localisation for Silverstripe

92421.6k26](/packages/tractorcow-silverstripe-fluent)[zerospam/laravel-gettext

Adds localization support to laravel applications in an easy way using Poedit and GNU gettext.

102207.4k](/packages/zerospam-laravel-gettext)[delight-im/i18n

Internationalization and localization for PHP

625.2k3](/packages/delight-im-i18n)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)[skillshare/formatphp

Internationalize PHP apps. This library provides an API to format dates, numbers, and strings, including pluralization and handling translations.

8029.6k](/packages/skillshare-formatphp)

PHPackages © 2026

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