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 6y ago1 watchersCompare

[ Source](https://github.com/Zn4rK/laravel-gettext)[ Packagist](https://packagist.org/packages/paxx/gettext)[ RSS](/packages/paxx-gettext/feed)WikiDiscussions master Synced 4d 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 26% 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://avatars.githubusercontent.com/u/873043?v=4)[Alexander](/maintainers/Zn4rK)[@Zn4rK](https://github.com/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

[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.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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