paxx/gettext

Simple Gettext wrapper for Laravel. Based on netson/l4gettext.
3,320 2
Install
composer require paxx/gettext:dev-master
PHP:>=5.3.0
License:MIT
Last Updated:Jun 9, 2020
Links: GitHub  ·  Packagist
Maintainer: Zn4rK

Gettext for Laravel

This library is heavliy inspired (and partially based on) 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

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

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

Todo

  • Write tests
  • Tidy stuff up

Version

1.0

License

MIT

Credits

  • Netson - thanks for creating l4gettext!

Related Packages

hmazter/laravel-log-queue

Laravel 5+ package to push Queued jobs to the log

12,507 5
devfactory/minify

A package for minifying styles and javascript for laravel 5

406,858 82
eusonlito/laravel-gettext

Simple gettext loader and parser

9,011 9
ajtarragona/tsystems-client

Client per serveis de l'ERP de Tsystems (Tercers, Padró, Vialer)

1,047 0
ricardosierra/minify

A package for minifying styles and javascript for laravel 5

1,003 1