Code Monkey home page Code Monkey logo

anandpilania / laravel-translations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mohmmedashraf/laravel-translations

0.0 1.0 0.0 262 KB

Laravel Translations UI is a package that provides a simple and friendly user interface for managing translations in a Laravel app. With this package, you can easily add, edit, delete, and export translations, and use the search function to find specific translations.

License: MIT License

JavaScript 5.96% PHP 61.66% CSS 0.12% Blade 32.25%

laravel-translations's Introduction

Logo Laravel-Translations

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

Packagist Packagist PHP from Packagist Laravel Version

Cover

Introduction

Laravel Translations UI is a package that provides a simple and friendly user interface for managing translations in a Laravel app. With this package, you can easily add, edit, delete, and export translations, and use the search function to find specific translations.

๐Ÿ“บ Watch a 4-minute video by Povilas Korop showcasing the package.

Requirements

  • PHP 7.4 or higher
  • Laravel 8.x or higher

Features

  • View, create, and delete translations
  • Manage translation keys
  • Filter by translation keys or values
  • Import and export translations
  • Search function to find specific translations
  • and more...

Installation

To install Laravel Translations UI in your Laravel project, run the following command:

composer require outhebox/laravel-translations

After installing the package, you'll need to publish its assets by running the following command:

php artisan translations:install

Before you can import translations, you'll need to migrate your database. Run the following command to do so:

php artisan migrate

Usage

To import your translations, run the following command:

php artisan translations:import

To import and overwrite all previous translations, use the following command:

php artisan translations:import --fresh

To access the translations UI, visit /translations in your browser. If you are using a production environment, you will need to login to your application before accessing the translations UI.

You can customize the authorization gate in the configuration file to control access to the translations UI in non-local environments. For more information, see for more details Authorization.

Exporting Translations

To export your translations, run the following command:

php artisan translations:export

Authorization

By default, the Translations UI dashboard can only be accessed in the local environment. The authorization gate in the app/Providers/TranslationsServiceProvider.php file controls access to the Translations UI dashboard in non-local environments. You can modify this gate as needed to restrict access to your Translations UI installation.

To customize the authorization gate, you can define a closure in the gate method of the TranslationsServiceProvider class:

protected function gate()
{
    Gate::define('viewLaravelTranslationsUI', function ($user) {
        return in_array($user->email, [
            // return true or false based on your authorization logic
        ]);
    });
}

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

Thank you for considering supporting the development of this package! If you'd like to contribute, you can buy me a coffee or sponsor me to help keep me motivated to continue improving this package. You can also support the project by starring โญ the repository.

To buy me a coffee, click the button below:

Buy Me A Coffee

Credits

License

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

laravel-translations's People

Contributors

mohmmedashraf avatar shahghasiadil avatar elguitarraverde avatar aaronlil avatar goatform avatar kmaking avatar thinkverse avatar povilaskorop avatar ronildo-sousa avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.