{"id":15525172,"url":"https://github.com/antonioribeiro/glottos","last_synced_at":"2025-10-06T01:31:42.988Z","repository":{"id":57044212,"uuid":"14927017","full_name":"antonioribeiro/glottos","owner":"antonioribeiro","description":"A PHP 5.3+ Translation/Localization System","archived":false,"fork":false,"pushed_at":"2017-01-31T02:39:47.000Z","size":128,"stargazers_count":69,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-19T07:14:38.360Z","etag":null,"topics":["laravel-messages","localization","php","translation"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonioribeiro.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-04T15:10:03.000Z","updated_at":"2023-04-17T13:26:05.000Z","dependencies_parsed_at":"2022-08-24T04:50:13.451Z","dependency_job_id":null,"html_url":"https://github.com/antonioribeiro/glottos","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/antonioribeiro/glottos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fglottos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fglottos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fglottos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fglottos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonioribeiro","download_url":"https://codeload.github.com/antonioribeiro/glottos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonioribeiro%2Fglottos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278547774,"owners_count":26004772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel-messages","localization","php","translation"],"created_at":"2024-10-02T10:55:21.388Z","updated_at":"2025-10-06T01:31:42.971Z","avatar_url":"https://github.com/antonioribeiro.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Glottos \n\n[![Latest Stable Version](https://poser.pugx.org/pragmarx/glottos/v/stable.png)](https://packagist.org/packages/pragmarx/glottos) [![Build Status](https://travis-ci.org/antonioribeiro/glottos.png)](https://travis-ci.org/antonioribeiro/glottos)\n\n#### An Online Translation/Localization System for Laravel Web Artisans\n\n##### Check out [Glottos Admin](https://github.com/antonioribeiro/glottosAdmin), a full featured site translation system built with Glottos.\n\nA quick overview of what you are able to do with it:\n\n```php\n\n// Use the Facade to set a locale\n\nGlottos::setLocale('pt_BR');\n\n// And just use it\n\nGlottos::translate('Laravel is a PHP Framework');\n\n// There's a helper\n\ng('Laravel is a PHP Framework');\n\n// Choose a particular locale\n\nGlottos::translate('Laravel is a PHP Framework', 'pt_BR')\n\n// or \n\nGlottos::translate('Laravel is a PHP Framework', 'pt-br')\n\n// Glottos let you choose between keys and natural language:\n\nGlottos::translate('key::home.describe.laravel') \nGlottos::translate('natural::Laravel is a PHP Framework') \n\n// or you can just define your default as natural and use:\n\nGlottos::translate('Laravel is a PHP Framework') \n\n// It will break your paragraphs in sentences\n\nGlottos::translate('Laravel is a PHP Framework. Laravel was written by Taylor Otwell.')\n\n// To not repeat itself, it will store those two sentences in your database:\n\n'Laravel is a PHP Framework'\n'Laravel was written by Taylor Otwell'\n\n// Removing punctuation and special chars.\n\n// With a simple blade trick \n\nBlade::extend(function ($view) {\n\n\treturn preg_replace(\n\t\t                 '/{{\\'((.|\\s)*?)\\'}}/', \n\t                     '\u003c?php echo Glottos::translate(\"$1\"); ?\u003e', $view\n\t                   );\n\n});\n\n// You can use it beautifully in your Views:\n\n\u003cp\u003e{{'Laravel is a PHP Framework'}}\u003c/p\u003e\n\n// You can still use the Lang Facade, Glottos has a compatible one\n\nLang::trans('Photography')\n\n// And use choice\n\nLang::choice('Photography|Photographies', 100, array(), 'pt_BR')\n\nGlottos::choice('Photography|Photographies', 100, array(), 'pt_BR')\n\n// And dozens of other features, like importing your current language files\n\n```\n\nThe 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.\n\n### Schema\n\nBasically Glottos will create and sometimes populate a bunch of tables for\n\n- Countries - 127\n- Languages - 129\n- Locales - 323 - Each one with its proper regional language name\n- Messages - (is stores hashes of the primary message)\n- Translations - one row for each message x locale\n\nHere's a view of how Laravel's messages are stored in the Admin site:\n\n![Laravel site messages in Glottos](http://puu.sh/5CWYM.png)\n\n### Installation\n\n#### Requirements\n\n- Any flavour of PHP 5.3.7+ should do\n- [optional] PHPUnit to execute the test suite\n\n#### Frameworks\n\nSince 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.\n\n#### With Composer\n\n`composer require pragmarx/glottos dev-master`\n\nOnce this operation completes, add the service provider to your app/config/app.php:\n\n```\n'PragmaRX\\Glottos\\Vendor\\Laravel\\ServiceProvider',\n```\n\nMigrate Glottos tables:\n\n```\nphp artisan migrate --package=pragmarx/glottos\n```\n\nImport your current language files:\n\n```\nphp artisan glottos:import\n```\n\nAnd you should be good to go. Enjoy!\n\n\u003ca name=\"about-author\"/\u003e\n\n### TODO\n\n- Add a real cache layer to it.\n- Add more frameworks and data access drivers.\n\n### Author\n\nAntonio Carlos Ribeiro - \u003cacr@antoniocarlosribeiro.com\u003e - \u003chttp://twitter.com/iantonioribeiro\u003e\n\n\u003ca name=\"about-license\"/\u003e\n### License\n\nGlottos is licensed under the MIT License - see the `LICENSE` file for details\n\n### Contributing\n\nPull requests and issues are more than welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonioribeiro%2Fglottos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonioribeiro%2Fglottos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonioribeiro%2Fglottos/lists"}