pezhvak/laravel-translator

A package to finally be able to localize projects without worrying about updating strings.

1.3 2023-10-27 19:02 UTC

This package is auto-updated.

Last update: 2024-04-27 20:14:18 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Installation

You can install the package via composer:

composer require pezhvak/laravel-translator

You can publish the config file with:

php artisan vendor:publish --tag="laravel-translator-config"

make sure you add these environment variables to your .env file.

DEEPL_AUTH_KEY=<put your deepl token here>

Usage

First migrate the database:

php artisan migrate

Now you can run the following command to detect changes and translate strings:

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):

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:

php artisan translator:translate [new_locale] --force

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.