PHPackages                             kasseler/gettext - 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. kasseler/gettext

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

kasseler/gettext
================

Gettext library

1.0.1(11y ago)016GPLPHPPHP &gt;=5.3.0

Since Mar 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/RobinCK/gettext)[ Packagist](https://packagist.org/packages/kasseler/gettext)[ Docs](http://kasseler-cms.net)[ RSS](/packages/kasseler-gettext/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Gettext Component
=================

[](#gettext-component)

[![Build Status](https://camo.githubusercontent.com/b754f85624c1a8afa98665c6cba4c5ce61954434b3d1a9fa9b8464e40433c069/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f526f62696e434b2f676574746578742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/RobinCK/gettext/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7028843bc43052c8aebf35fea02e729a47bebcace1fb3236fc014cda3bad9a54/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f526f62696e434b2f676574746578742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/RobinCK/gettext/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/0af0a3f5d697d48ea18a9a819c401a0e908674921a94c4f4b43f1d8d498fa7cb/68747470733a2f2f706f7365722e707567782e6f72672f6b617373656c65722f676574746578742f762f737461626c652e737667)](https://packagist.org/packages/kasseler/gettext)[![Total Downloads](https://camo.githubusercontent.com/0cbee32c3e82adb59af8a77872c693006b40b9a6c8067637597f9b86d0f7ab11/68747470733a2f2f706f7365722e707567782e6f72672f6b617373656c65722f676574746578742f646f776e6c6f6164732e737667)](https://packagist.org/packages/kasseler/gettext)[![Latest Unstable Version](https://camo.githubusercontent.com/7f1da85d09cda161a6d20a80b6c44b8db20261c6d96dab37ffc4b5a1e8c00ef0/68747470733a2f2f706f7365722e707567782e6f72672f6b617373656c65722f676574746578742f762f756e737461626c652e737667)](https://packagist.org/packages/kasseler/gettext)[![License](https://camo.githubusercontent.com/078f6c8fc868122dec6ef1e9184e3c5070b927e1f53e05c5e4c72ff6c6940d85/68747470733a2f2f706f7365722e707567782e6f72672f6b617373656c65722f676574746578742f6c6963656e73652e737667)](https://packagist.org/packages/kasseler/gettext)

Gettext \*.mo files reader for PHP. Original package

### Requirements

[](#requirements)

- PHP &gt;= 5.3

### Installation

[](#installation)

```
$ composer require kasseler/config
```

### Introduction

[](#introduction)

How many times did you look for a good translation tool, and found out that gettext is best for the job? Many times. How many times did you try to use gettext in PHP, but failed miserably, because either your hosting provider didn't support it, or the server didn't have adequate locale? Many times. Well, this is a solution to your needs. It allows using gettext tools for managing translations, yet it doesn't require gettext library at all. It parses generated MO files directly, and thus might be a bit slower than the (maybe provided) gettext library. PHP-gettext is a simple reader for GNU gettext MO files. Those are binary containers for translations, produced by GNU msgfmt.

#### Usage

[](#usage)

To force the use of the class, you must install define:

```
define('GETTEXT_CLASS', true);
```

You must use the initialization function:

```
//                    filename   locale   charset
init_translate_domain('message', 'fr',    'UTF-8',  'path_to_locales_dir');
```

***Native***

```
echo gettext('Add');
echo ngettext('Minute', 'Minutes', 2);
```

***Usage class***

```
echo _gettext('Add');
echo _ngettext('Minute', 'Minutes', 2);
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

Every ~22 days

Total

2

Last Release

4072d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/24ea64ad06776e5f6ad1e3d4e2bceb16dab50e52445699db7d6f942cd91de3eb?d=identicon)[kasseler](/maintainers/kasseler)

---

Top Contributors

[![RobinCK](https://avatars.githubusercontent.com/u/10226014?v=4)](https://github.com/RobinCK "RobinCK (12 commits)")

---

Tags

gettextlocalemo reader

### Embed Badge

![Health badge](/badges/kasseler-gettext/health.svg)

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

###  Alternatives

[gettext/gettext

PHP gettext manager

70130.2M102](/packages/gettext-gettext)[fightbulc/moment

Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js

9693.2M10](/packages/fightbulc-moment)[phpmyadmin/motranslator

Translation API for PHP using Gettext MO files

591.8M8](/packages/phpmyadmin-motranslator)[fisharebest/localization

A lightweight localization database and translation tools, with data from the CLDR, IANA, ISO, etc.

3191.1k2](/packages/fisharebest-localization)[delight-im/i18n

Internationalization and localization for PHP

625.2k3](/packages/delight-im-i18n)[laravel-lang/locales

Basic functionality for working with localizations

134.5M12](/packages/laravel-lang-locales)

PHPackages © 2026

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