Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pezhvak/laravel-translator
A package to finally be able to localize projects without worrying about updating strings.
https://github.com/pezhvak/laravel-translator
Last synced: about 1 month ago
JSON representation
A package to finally be able to localize projects without worrying about updating strings.
- Host: GitHub
- URL: https://github.com/pezhvak/laravel-translator
- Owner: Pezhvak
- License: mit
- Created: 2022-07-07T11:06:41.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-27T19:07:01.000Z (about 1 year ago)
- Last Synced: 2024-11-17T03:36:15.543Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# laravel-translator
[![Latest Version on Packagist](https://img.shields.io/packagist/v/pezhvak/laravel-translator.svg?style=flat-square)](https://packagist.org/packages/pezhvak/laravel-translator)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/pezhvak/laravel-translator/run-tests?label=tests)](https://github.com/pezhvak/laravel-translator/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/pezhvak/laravel-translator/Check%20&%20fix%20styling?label=code%20style)](https://github.com/pezhvak/laravel-translator/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/pezhvak/laravel-translator.svg?style=flat-square)](https://packagist.org/packages/pezhvak/laravel-translator)## Installation
You can install the package via composer:
```bash
composer require pezhvak/laravel-translator
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="laravel-translator-config"
```make sure you add these environment variables to your `.env` file.
```dotenv
DEEPL_AUTH_KEY=
```## Usage
First migrate the database:
```shell
php artisan migrate
```Now you can run the following command to detect changes and translate strings:
```shell
php artisan translator:translate
```Sometimes you want to translate only few locales, you can do this by providing them in the first parameter (separate them by comma if you want to provide multiple locales):
```shell
php artisan translator:translate en,fa
```If you add a new locale, it won't get translated since there is no changed string in the default language, to do this force the translation:
```shell
php artisan translator:translate [new_locale] --force
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/Pezhvak/.github/blob/main/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Pezhvak](https://github.com/Pezhvak)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.