PHPackages                             pragmarx/glottos - 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. pragmarx/glottos

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

pragmarx/glottos
================

A PHP 5.3+ Online Translation/Localization System

v1.5.3(9y ago)692496[1 PRs](https://github.com/antonioribeiro/glottos/pulls)BSD-3-ClausePHPPHP &gt;=5.3.7

Since Dec 5Pushed 9y ago4 watchersCompare

[ Source](https://github.com/antonioribeiro/glottos)[ Packagist](https://packagist.org/packages/pragmarx/glottos)[ RSS](/packages/pragmarx-glottos/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (5)Versions (7)Used By (0)

Glottos
=======

[](#glottos)

[![Latest Stable Version](https://camo.githubusercontent.com/b9ff8b605229b2643170f543d0b4a4b7bda66072742578773482e18eb3b55199/68747470733a2f2f706f7365722e707567782e6f72672f707261676d6172782f676c6f74746f732f762f737461626c652e706e67)](https://packagist.org/packages/pragmarx/glottos) [![Build Status](https://camo.githubusercontent.com/a75fab6b9ba67f6ebed41e375015282ff9c6d293eedfbfc862e940f146c4dd1e/68747470733a2f2f7472617669732d63692e6f72672f616e746f6e696f7269626569726f2f676c6f74746f732e706e67)](https://travis-ci.org/antonioribeiro/glottos)

#### An Online Translation/Localization System for Laravel Web Artisans

[](#an-online-translationlocalization-system-for-laravel-web-artisans)

##### Check out [Glottos Admin](https://github.com/antonioribeiro/glottosAdmin), a full featured site translation system built with Glottos.

[](#check-out-glottos-admin-a-full-featured-site-translation-system-built-with-glottos)

A quick overview of what you are able to do with it:

```
// Use the Facade to set a locale

Glottos::setLocale('pt_BR');

// And just use it

Glottos::translate('Laravel is a PHP Framework');

// There's a helper

g('Laravel is a PHP Framework');

// Choose a particular locale

Glottos::translate('Laravel is a PHP Framework', 'pt_BR')

// or

Glottos::translate('Laravel is a PHP Framework', 'pt-br')

// Glottos let you choose between keys and natural language:

Glottos::translate('key::home.describe.laravel')
Glottos::translate('natural::Laravel is a PHP Framework')

// or you can just define your default as natural and use:

Glottos::translate('Laravel is a PHP Framework')

// It will break your paragraphs in sentences

Glottos::translate('Laravel is a PHP Framework. Laravel was written by Taylor Otwell.')

// To not repeat itself, it will store those two sentences in your database:

'Laravel is a PHP Framework'
'Laravel was written by Taylor Otwell'

// Removing punctuation and special chars.

// With a simple blade trick

Blade::extend(function ($view) {

	return preg_replace(
		                 '/{{\'((.|\s)*?)\'}}/',
	                     '', $view
	                   );

});

// You can use it beautifully in your Views:

{{'Laravel is a PHP Framework'}}

// You can still use the Lang Facade, Glottos has a compatible one

Lang::trans('Photography')

// And use choice

Lang::choice('Photography|Photographies', 100, array(), 'pt_BR')

Glottos::choice('Photography|Photographies', 100, array(), 'pt_BR')

// And dozens of other features, like importing your current language files
```

The idea behind this package is very simple: you need your web app to become multi-language fast so you better translate it all online, with some help from co-workers or the community.

### Schema

[](#schema)

Basically Glottos will create and sometimes populate a bunch of tables for

- Countries - 127
- Languages - 129
- Locales - 323 - Each one with its proper regional language name
- Messages - (is stores hashes of the primary message)
- Translations - one row for each message x locale

Here's a view of how Laravel's messages are stored in the Admin site:

[![Laravel site messages in Glottos](https://camo.githubusercontent.com/4aa0c9a1da34ecd168150f3c1b95e5a3f5bc61f481cda43c683aa1780d0db064/687474703a2f2f7075752e73682f354357594d2e706e67)](https://camo.githubusercontent.com/4aa0c9a1da34ecd168150f3c1b95e5a3f5bc61f481cda43c683aa1780d0db064/687474703a2f2f7075752e73682f354357594d2e706e67)

### Installation

[](#installation)

#### Requirements

[](#requirements)

- Any flavour of PHP 5.3.7+ should do
- \[optional\] PHPUnit to execute the test suite

#### Frameworks

[](#frameworks)

Since Glottos depends on data layer it is a Laravel 4.x ready package, but it was coded to be as much agnostic as possible, so you can create new drivers and use it on your own frameworks. You can even send me PRs to add them to the main code.

#### With Composer

[](#with-composer)

`composer require pragmarx/glottos dev-master`

Once this operation completes, add the service provider to your app/config/app.php:

```
'PragmaRX\Glottos\Vendor\Laravel\ServiceProvider',

```

Migrate Glottos tables:

```
php artisan migrate --package=pragmarx/glottos

```

Import your current language files:

```
php artisan glottos:import

```

And you should be good to go. Enjoy!

### TODO

[](#todo)

- Add a real cache layer to it.
- Add more frameworks and data access drivers.

### Author

[](#author)

Antonio Carlos Ribeiro -  -

\### License Glottos is licensed under the MIT License - see the `LICENSE` file for details

### Contributing

[](#contributing)

Pull requests and issues are more than welcome.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 89% 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 ~288 days

Total

5

Last Release

3389d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9421a69d192db597169ec3519ad3efc6a35a660e4525e2ed08f6c753b908e86?d=identicon)[AntonioCarlosRibeiro](/maintainers/AntonioCarlosRibeiro)

---

Top Contributors

[![antonioribeiro](https://avatars.githubusercontent.com/u/3182864?v=4)](https://github.com/antonioribeiro "antonioribeiro (65 commits)")[![ryross](https://avatars.githubusercontent.com/u/152982?v=4)](https://github.com/ryross "ryross (6 commits)")[![dcrystalj](https://avatars.githubusercontent.com/u/1460727?v=4)](https://github.com/dcrystalj "dcrystalj (1 commits)")[![SwissWeb](https://avatars.githubusercontent.com/u/8927460?v=4)](https://github.com/SwissWeb "SwissWeb (1 commits)")

---

Tags

laravel-messageslocalizationphptranslationlaravellocalizationtranslation

### Embed Badge

![Health badge](/badges/pragmarx-glottos/health.svg)

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

###  Alternatives

[mariuzzo/laravel-js-localization

Laravel Localization in JavaScript

6073.9M3](/packages/mariuzzo-laravel-js-localization)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[tio/laravel

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

170318.5k](/packages/tio-laravel)[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)

PHPackages © 2026

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