{"id":13609294,"url":"https://github.com/ben182/laravel-auto-translate","last_synced_at":"2025-04-05T15:08:02.514Z","repository":{"id":52074458,"uuid":"170029630","full_name":"ben182/laravel-auto-translate","owner":"ben182","description":"Automatically translate your language files using a translator service","archived":false,"fork":false,"pushed_at":"2021-05-08T07:28:52.000Z","size":82,"stargazers_count":178,"open_issues_count":8,"forks_count":50,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-29T14:10:06.673Z","etag":null,"topics":["laravel","laravel-5-package","laravel-package","php","translations"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ben182.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-10T21:31:13.000Z","updated_at":"2025-03-23T00:46:45.000Z","dependencies_parsed_at":"2022-09-06T07:42:27.665Z","dependency_job_id":null,"html_url":"https://github.com/ben182/laravel-auto-translate","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben182%2Flaravel-auto-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben182%2Flaravel-auto-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben182%2Flaravel-auto-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ben182%2Flaravel-auto-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ben182","download_url":"https://codeload.github.com/ben182/laravel-auto-translate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353746,"owners_count":20925329,"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","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","laravel-5-package","laravel-package","php","translations"],"created_at":"2024-08-01T19:01:33.912Z","updated_at":"2025-04-05T15:08:02.477Z","avatar_url":"https://github.com/ben182.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003ch6 align=\"center\"\u003e\n    \u003cimg src=\"https://i.ibb.co/5hhcPSH/defile-de-mode-1.png\" width=\"300\"/\u003e\n\u003c/h6\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/ben182/laravel-auto-translate/releases\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/7aeaaffdab372bb7f1a7bc771400d9e18295916b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f62656e3138322f6c61726176656c2d6175746f2d7472616e736c6174652e7376673f7374796c653d666c61742d737175617265\" alt=\"Latest Version\" data-canonical-src=\"https://img.shields.io/github/release/ben182/laravel-auto-translate.svg?style=flat-square\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/ben182/laravel-auto-translate\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/8c01aa130a16fabf6a8e313719f4f274c7c401b4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f62656e3138322f6c61726176656c2d6175746f2d7472616e736c6174652f6d61737465722e7376673f7374796c653d666c61742d737175617265\" alt=\"Build Status\" data-canonical-src=\"https://img.shields.io/travis/ben182/laravel-auto-translate/master.svg?style=flat-square\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://scrutinizer-ci.com/g/ben182/laravel-auto-translate\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/a2132ab348aaaeae4e0cfee432965a86b8d6b7af/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f62656e3138322f6c61726176656c2d6175746f2d7472616e736c6174652e7376673f7374796c653d666c61742d737175617265\" alt=\"Quality Score\" data-canonical-src=\"https://img.shields.io/scrutinizer/g/ben182/laravel-auto-translate.svg?style=flat-square\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\nWith this package you can translate your language files using a translator service. The package ships with a free Google Translate version, Google Translate API and Deepl.\n\nSpecify a source language and a target language and it will automatically translate your files. This is useful if you want to prototype something quickly or just a first idea of the translation for later editing. The package ships with two artisan commands. One for translating all the missing translations that are set in the source language but not in the target language. The other one for translating all source language files and overwriting everything in the target language.\n\n## Installation\n\nThis package can be used in Laravel 5.6 or higher and needs PHP 7.2 or higher.\n\nYou can install the package via composer:\n\n```bash\ncomposer require ben182/laravel-auto-translate\n```\n\n## Config\n\nAfter installation publish the config file:\n\n```bash\nphp artisan vendor:publish --provider=\"Ben182\\AutoTranslate\\AutoTranslateServiceProvider\"\n```\n\nYou can specify your source language, the target language(s), the translator and the path to your language files in there.\n\n## Translators\n\n| Name                   | Free | File                                                    | Documentation                       | Available languages |\n|------------------------|------|---------------------------------------------------------|-------------------------------------|----------|\n| Google Translate HTTP  | Yes  | Ben182\\AutoTranslate\\Translators\\SimpleGoogleTranslator | /                                   | Over 100 |\n| Google Cloud Translate | No   | Ben182\\AutoTranslate\\Translators\\GoogleCloudTranslator  | [Documentation](https://cloud.google.com/translate/) | Over 100 |\n| Deepl API v2           | No   | Ben182\\AutoTranslate\\Translators\\DeeplTranslator        | [Documentation](https://www.deepl.com/docs-api.html) | EN, DE, FR, ES, PT, IT, NL, PL, RU |\n\nIf you have lots of translations to make I recommend Google Cloud Translate or Deepl. They are fast, reliable and you will not encounter any rate limiting.\n\n## Usage\n\n### Missing translations\n\nSimply call the artisan missing command for translating all the translations that are set in your source language, but not in your target language:\n\n```bash\nphp artisan autotrans:missing\n```\n\nE.g. you have English set as your source language. The source language has translations in auth.php:\n\n```php\n\u003c?php\n\nreturn [\n    'failed' =\u003e 'These credentials do not match our records.',\n    'throttle' =\u003e 'Too many login attempts. Please try again in :seconds seconds.',\n];\n```\n\nYour target language is German. The auth.php file has the following translations:\n\n```php\n\u003c?php\n\nreturn [\n    'failed' =\u003e 'Diese Kombination aus Zugangsdaten wurde nicht in unserer Datenbank gefunden.',\n];\n```\n\nThe artisan missing command will then translate the missing `auth.throttle` key.\n\n### All translations\n\nTo overwrite all your existing target language keys with the translation of the source language simply call:\n\n```bash\nphp artisan autotrans:all\n```\n\nThis will overwrite every single key with a translation of the equivalent source language key.\n\n### Parameters\n\nSometimes you have translations like these:\n\n```php\n'welcome' =\u003e 'Welcome, :name',\n```\n\nThey can be replaced with variables. When we pass these placeholders to a translator service, weird things can happen. Sometimes the placeholder comes back in upper-case letters or it has been translated. Thankfully the package will respect your variable placeholders, so they will be the same after the translation.\n\n## Extending\n\nYou can create your own translator by creating a class that implements `\\Ben182\\AutoTranslate\\Translators\\TranslatorInterface`. Simply reference it in your config file.\n\n### Testing\n\n``` bash\ncomposer test\n```\n\n### Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email moin@benjaminbortels.de instead of using the issue tracker.\n\n## Credits\n\n- [Benjamin Bortels](https://github.com/ben182)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Laravel Package Boilerplate\n\nThis package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben182%2Flaravel-auto-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fben182%2Flaravel-auto-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fben182%2Flaravel-auto-translate/lists"}