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

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

paxx/gettext
============

Simple Gettext wrapper for Laravel. Based on netson/l4gettext.

23.3k1[1 issues](https://github.com/Zn4rK/laravel-gettext/issues)PHP

Since Jun 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Zn4rK/laravel-gettext)[ Packagist](https://packagist.org/packages/paxx/gettext)[ RSS](/packages/paxx-gettext/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Gettext for Laravel
===================

[](#gettext-for-laravel)

This library is heavliy inspired (and partially based on) [netson/l4gettext](https://github.com/netson/l4gettext) and you should really use his library instead of mine.

I wrote this because I wanted to learn more about gettext (and package creating with laravel in general). I do not plan on supporting this library.

Get started
-----------

[](#get-started)

First of you need to publish the configuration

```
php artisan config:publish paxx/gettext
```

After your changes to the config, you can go ahead and add the service provider to the list of providers in app/config/app.php:

```
'Paxx\Gettext\GettextServiceProvider'
```

You might need to make sure that php can write to app/lang since that is the folder where the POT-files will be placed in.

To change locale you can then use:

```
Gettext::setLocale('sv_SE');
```

Just make sure that you have the locales installed on your system.

After everything is set, you can run

```
php artisan gettext
```

And your translations will be extracted from the views and added to the POT-file.

Dependencies
------------

[](#dependencies)

- gettext
- xgettext (Ships with gettext on most systems)
- msgmerge (Ships with gettext on most systems)

Todo
----

[](#todo)

- Write tests
- Tidy stuff up

Version
-------

[](#version)

1.0

License
-------

[](#license)

MIT

Credits
-------

[](#credits)

- [Netson](https://github.com/netson) - thanks for creating l4gettext!

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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://www.gravatar.com/avatar/ead5dd0587fdc9b1f980520f0f433e432d1a07951c8318c1333250b25fb4ee46?d=identicon)[Zn4rK](/maintainers/Zn4rK)

---

Top Contributors

[![Zn4rK](https://avatars.githubusercontent.com/u/873043?v=4)](https://github.com/Zn4rK "Zn4rK (15 commits)")[![sisve](https://avatars.githubusercontent.com/u/748375?v=4)](https://github.com/sisve "sisve (5 commits)")

### Embed Badge

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

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

###  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)
