uselocale/locale-laravel

Manage translations with Locale and smoothly synchronize them with your project using our simple package commands.

2.0.1 2023-02-15 14:30 UTC

README

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

Locale is the first localization platform specifically built for Laravel. Forget the old-fashioned email exchanges between teams and translators that always slow down project development, manage translations with our admin panel and smoothly synchronize the files with your project using our simple package commands.

Locale screenshot

Installation

Follow the details provided on Locale after creating a new project.

Available commands

Setup

php artisan locale:setup

You only need to run this command once. It will upload your existing translations to Locale and prepare your local files to be synced in the future.

Your local files will be reformatted but won't change their content.

Sync

php artisan locale:sync

Run this command to upload any new translation keys to Locale and download updates on all your target languages.

If there's any conflict during the process, you'll receive a confirmation message.

Forcing Sync to run

Syncing your translation will update your local files with new translations for Locale and upload new translations to Locale. To keep you informed and in control with everything, you will be prompted for a confirmation before the command is executed. To force the command to run without a prompt, use the --force flag:

php artisan locale:sync --force

Purge unused translations

By default, nothing is deleted from Locale. If you delete translation keys from your local code and sync, translations will still be available from Locale. This is useful if you are working with multiple branches or some big new features.

However, sometimes you really need to delete old and unused translation keys from Locale. To do that, use the --purge flag:

php artisan locale:sync --purge

Warning All keys that are not present in the current local branch will be permanently deleted.

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.