{"id":19653869,"url":"https://github.com/devaslanphp/auto-translate","last_synced_at":"2025-10-09T15:35:30.137Z","repository":{"id":65222854,"uuid":"588581186","full_name":"devaslanphp/auto-translate","owner":"devaslanphp","description":"Automatically generate translation JSON files for your Laravel project","archived":false,"fork":false,"pushed_at":"2024-04-18T22:59:19.000Z","size":22,"stargazers_count":65,"open_issues_count":4,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-02T14:41:40.134Z","etag":null,"topics":["googletranslate","laravel","package","translation"],"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/devaslanphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-13T13:27:43.000Z","updated_at":"2025-04-23T12:09:50.000Z","dependencies_parsed_at":"2023-02-11T22:15:48.300Z","dependency_job_id":null,"html_url":"https://github.com/devaslanphp/auto-translate","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devaslanphp%2Fauto-translate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devaslanphp%2Fauto-translate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devaslanphp%2Fauto-translate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devaslanphp%2Fauto-translate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devaslanphp","download_url":"https://codeload.github.com/devaslanphp/auto-translate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252998547,"owners_count":21838052,"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":["googletranslate","laravel","package","translation"],"created_at":"2024-11-11T15:15:32.446Z","updated_at":"2025-10-09T15:35:25.093Z","avatar_url":"https://github.com/devaslanphp.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Auto Translations\r\n\r\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/devaslanphp/auto-translate.svg?style=flat-square)](https://packagist.org/packages/devaslanphp/auto-translate)\r\n[![Total Downloads](https://img.shields.io/packagist/dt/devaslanphp/auto-translate.svg?style=flat-square)](https://packagist.org/packages/devaslanphp/auto-translate)\r\n\r\nThis package provides a simple way to automatically generate translation JSON files for you, it helps you to generate the missing translation also.\r\nThe translation are generated automatically using Google Translations, based on the package `stichoza/google-translate-php` and exporting translations string from your source code using the package `kkomelin/laravel-translatable-string-exporter`.\r\n\r\n# Installation\r\n\r\nYou can install the package via composer:\r\n\r\n```shell\r\ncomposer require devaslanphp/auto-translate\r\n```\r\n\r\nAdd the package provider into your `config/app.php` file:\r\n\r\n```php\r\n//...\r\n\r\n'providers' =\u003e [\r\n      // ...\r\n\r\n      \\Devaslanphp\\AutoTranslate\\AutoTranslateProvider::class,\r\n],\r\n\r\n// ...\r\n```\r\n\r\n*REQUIRED*: You need to publish the package config file, so you can update the `base_locale` and `locales` list as needed:\r\n\r\n```shell\r\nphp artisan vendor:publish --tag=auto-translate-config\r\n```\r\n\r\n**That's it**, you can use the package commands to generate missing translations and automatically translate them using Google Translations\r\n\r\n# Configuration\r\n\r\nThe configuration file of this package comes like below:\r\n\r\n```php\r\n\u003c?php\r\n\r\nreturn [\r\n\r\n    /*\r\n     * \r\n     * Locales managed by auto-translation package, will be used by the \r\n     * command \"auto:translate\" to generate a JSON file for each of this \r\n     * locales, and by the command \"translate:missing\" to generate their\r\n     * missing translations\r\n     * \r\n     */\r\n    'locales' =\u003e [\r\n        'fr',\r\n        'ar'\r\n    ],\r\n\r\n    /*\r\n     * \r\n     * The base locale to use when using the command \"translate:missing\" to\r\n     * generate missing translations for other JSON files\r\n     * \r\n     */\r\n    'base_locale' =\u003e 'fr'\r\n\r\n];\r\n```\r\n\r\nI think it's well documented, I will let you check it.\r\n\r\n## Usage\r\n\r\nThe package provides 2 Artisan commands:\r\n\r\n### Automatic translations generation\r\n\r\nTo generate translation JSON files from your source code, you can execute the following command:\r\n\r\n```shell\r\nphp artisan auto:translate\r\n```\r\n\r\nThis command will check your configuration `auto-translate.locales` to generate for each locale of this list a JSON file based on your source code (`@lang()`, `__()`, ...) and translate the string into the desired locale based on Google Translations.\r\n\r\n### Translate missing keys\r\n\r\nThe package provides also a command to let you generate translations for missing keys based on a specific JSON file (`auto-translate.base_locale`.json). To generate missing translation, you only need to execute the following command:\r\n\r\n```shell\r\nphp artisan translate:missing\r\n```\r\n\r\n## Credits\r\n\r\n- [All Contributors](https://github.com/devaslanphp/auto-translate/graphs/contributors)\r\n\r\n## License\r\n\r\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevaslanphp%2Fauto-translate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevaslanphp%2Fauto-translate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevaslanphp%2Fauto-translate/lists"}