{"id":26223421,"url":"https://github.com/backstagephp/laravel-translations","last_synced_at":"2025-04-19T11:32:57.441Z","repository":{"id":278533227,"uuid":"916723518","full_name":"backstagephp/laravel-translations","owner":"backstagephp","description":"A Laravel Translations package. Also works well with our Filament Translations package:","archived":false,"fork":false,"pushed_at":"2025-04-07T12:46:14.000Z","size":179,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T13:38:38.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/vormkracht10/filament-translations","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/backstagephp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"vormkracht10"}},"created_at":"2025-01-14T16:39:25.000Z","updated_at":"2025-04-07T12:46:11.000Z","dependencies_parsed_at":"2025-03-10T09:26:21.658Z","dependency_job_id":"8235b1ee-ced6-49e4-bba4-073818a1ed44","html_url":"https://github.com/backstagephp/laravel-translations","commit_stats":null,"previous_names":["backstagephp/laravel-translations"],"tags_count":35,"template":false,"template_full_name":"vormkracht10/laravel-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstagephp%2Flaravel-translations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstagephp%2Flaravel-translations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstagephp%2Flaravel-translations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backstagephp%2Flaravel-translations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backstagephp","download_url":"https://codeload.github.com/backstagephp/laravel-translations/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249685166,"owners_count":21310556,"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":[],"created_at":"2025-03-12T17:32:42.882Z","updated_at":"2025-04-19T11:32:57.410Z","avatar_url":"https://github.com/backstagephp.png","language":"PHP","funding_links":["https://github.com/sponsors/vormkracht10"],"categories":[],"sub_categories":[],"readme":"# Laravel Translations package\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/backstage/laravel-translations.svg?style=flat-square)](https://packagist.org/packages/backstage/laravel-translations)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/backstagephp/laravel-translations/run-tests.yml?branch=main\u0026label=tests\u0026style=flat-square)](https://github.com/backstagephp/laravel-translations/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/backstagephp/laravel-translations/fix-php-code-style-issues.yml?branch=main\u0026label=code%20style\u0026style=flat-square)](https://github.com/backstagephp/laravel-translations/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/backstage/laravel-translations.svg?style=flat-square)](https://packagist.org/packages/backstage/laravel-translations)\n\n## Nice to meet you, we're [Vormkracht10](https://vormrkacht10.nl)\n\nHi! We are a web development agency from Nijmegen in the Netherlands and we use Laravel for everything: advanced websites with a lot of bells and whitles and large web applications.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require backstage/laravel-translations\n```\n\nYou can publish and run the migrations with:\n\n```bash\nphp artisan vendor:publish --provider=\"Backstage\\Translations\\Laravel\\TranslationServiceProvider\"\nphp artisan migrate\n```\n\nThis is the contents of the published config file:\n\n```php\nuse EchoLabs\\Prism\\Enums\\Provider;\n\n[\n    'scan' =\u003e [\n        'paths' =\u003e [\n            base_path(),\n        ],\n        'files' =\u003e [\n            '*.php',\n            '*.blade.php',\n            '*.json',\n        ],\n\n        'functions' =\u003e [\n            'trans',\n            'trans_choice',\n            'Lang::transChoice',\n            'Lang::trans',\n            'Lang::get',\n            'Lang::choice',\n            '@lang',\n            '@choice',\n            '__',\n        ],\n    ],\n\n    'translators' =\u003e [\n        'default' =\u003e env('TRANSLATION_DRIVER', 'google-translate'),\n\n        'drivers' =\u003e [\n            'google-translate' =\u003e [\n                // no options\n            ],\n\n            'ai' =\u003e [\n                'provider' =\u003e Provider::OpenAI, // Example provider\n                'model' =\u003e 'text-davinci-003', // Example model\n                'system_prompt' =\u003e 'You are an expert mathematician who explains concepts simply. The only thing you do it output what i ask. No comments, no extra information. Just the answer.', // Example system prompt\n            ],\n        ],\n    ],\n];\n\n```\n\nIf you have choosen the AI driver, please read the [Prism documentation](https://prism.echolabs.dev/providers/anthropic.html) on how to configure providers.\n\n## Usage\n\n### Add lang types\n\nIf you want to add a language use the following command:\n\n```bash\nphp artisan translations:languages:add {locale} {label}\n```\n\nFor example:\n\n```bash\nphp artisan translations:languages:add nl Nederlands\n\ntranslations:languages:add en English\n\ntranslations:languages:add fr-BE Français // French specifically for Belgians\n```\n\nThe command can also be used without in-command-line parameters\n\n### Scan for translations\n\nTo scan for translations within your Laravel application, use the following command:\n\n```bash\nphp artisan translations:scan\n```\n\n### Translate scanned translations\n\nTo translate the scanned translations, use the following command:\n\n```bash\nphp artisan translations:translate\n        {--all : Translate language strings for all languages}\n        {--code= : Translate language strings for a specific language}\n        {--update : Update and overwrite existing translations}\n```\n\nFor example:\n\n```bash\nphp artisan translations:translate --code=nl\n\nphp artisan translations:translate --code=en\n\nphp artisan translations:translate --code=fr-BE --update // overwrite existing translations\n\nphp artisan translations:translate // translate all languages\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n-   [Manoj Hortulanus](https://github.com/arduinomaster22)\n-   [Mark van Eijk](https://github.com/markvaneijk)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackstagephp%2Flaravel-translations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackstagephp%2Flaravel-translations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackstagephp%2Flaravel-translations/lists"}