mobidonia / laravel-translations

Laravel Translations UI provides a simple way to manage your app translations using a friendly UI, It allows you to add, edit, delete and export translations, and it also provides a search functionality to find translations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logo Laravel-Translations

Introduction | Installation | Usage | Authorization | Upgrade | Roadmap | Changelog

Packagist Packagist PHP from Packagist Laravel Version

Cover

Introduction

Laravel Translations UI provides a simple way to manage your app translations using a friendly UI, It allows you to add, edit, delete and export translations, and it also provides a search functionality to find translations.

Features

  • View & Create & Delete Translations.
  • Manage your translations keys.
  • Filter by translation keys or values,
  • and more...

Installation

You may use the Composer package manager to install Laravel Translations UI into your Laravel project:

composer require outhebox/laravel-translations

After installing Laravel Translations UI, publish its assets using the following commands.

php artisan translations:install

Migrate your database before importing translations, you can use the following command.

php artisan migrate

Usage

Import your translations using the following command.

php artisan translations:import

If you want to import & overwrite all your previous translations, use the following command.

php artisan translations:import --fresh

Then you can access the translations UI, you can visit the /translations in your browser, but first you need to login to your application if it's a production environment, and you can define who can access the translations UI in the configuration file, see for more details Authorization.

Exporting Translations

You can export your translations using the following command.

php artisan translations:export

Authorization

The Translations UI dashboard may be accessed at the /translations route. By default, you will only be able to access this dashboard in the local environment. Within your app/Providers/TranslationsServiceProvider.php file, there is an authorization gate definition. This authorization gate controls access to Translations UI Dashboard in non-local environments. You are free to modify this gate as needed to restrict access to your Translations UI installation:

protected function gate()
{
    Gate::define('viewLaravelTranslationsUI', function ($user) {
        return in_array($user->email, [
            //
        ]);
    });
}

Upgrading

When upgrading to a new major version of Laravel Translations UI, it's important that you carefully review the upgrade guide.

In addition, when upgrading to any new Translations UI version, you should re-publish Translations UI assets:

php artisan translations:publish

To keep the assets up-to-date and avoid issues in future updates, you may add the translations:publish command to the post-update-cmd scripts in your application's composer.json file:

{
    "scripts": {
        "post-update-cmd": [
            "@php artisan translations:publish --ansi"
        ]
    }
}

Roadmap

  • Add tests.
  • Improve the UI.
  • Vendor translations support.
  • Google Translate API integration.
  • Invite collaborators to manage translations.
  • Add revision history.
  • Add more features.

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Support

Hey 👋 My name is Mohamed Ashraf, I'm a full-stack web developer, if you like my work, you can buy me a coffee to keep me awake and coding, or sponsoring me, at least make sure you're supporting me by starring the repository.

Buy Me A Coffee

Credits

License

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

About

Laravel Translations UI provides a simple way to manage your app translations using a friendly UI, It allows you to add, edit, delete and export translations, and it also provides a search functionality to find translations.

License:MIT License


Languages

Language:PHP 59.3%Language:Blade 34.2%Language:JavaScript 6.4%Language:CSS 0.1%