Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sachnaror/translations-pack-laravel

The Laravel Translations UI package offers an intuitive and user-friendly interface designed for efficiently handling translations within a Laravel application. This package facilitates seamless tasks such as adding, editing, deleting, and exporting translations. Additionally, it includes a convenient search function, enabling users to effortlessly
https://github.com/sachnaror/translations-pack-laravel

translate translation

Last synced: about 1 month ago
JSON representation

The Laravel Translations UI package offers an intuitive and user-friendly interface designed for efficiently handling translations within a Laravel application. This package facilitates seamless tasks such as adding, editing, deleting, and exporting translations. Additionally, it includes a convenient search function, enabling users to effortlessly

Awesome Lists containing this project

README

        


Logo Laravel-Translations


Introduction |
Installation |
Usage |
Authorization |
Roadmap |


Packagist
Packagist
PHP from Packagist
Laravel Version

![Cover](https://user-images.githubusercontent.com/44909285/201598702-5bcd47ed-6202-41a1-af4a-40203b3b76ae.png)

### Introduction

The Laravel Translations UI package offers an intuitive and user-friendly interface designed for efficiently handling translations within a Laravel application. This package facilitates seamless tasks such as adding, editing, deleting, and exporting translations. Additionally, it includes a convenient search function, enabling users to effortlessly locate specific translations as needed.

### Requirements

- PHP 8.1 or higher
- Laravel 10.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:

```bash
composer require outhebox/laravel-translations
```

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

```bash
php artisan migrate
```

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

```bash
php artisan translations:install
```

### Usage

To import your translations, run the following command:

```bash
php artisan translations:import
```

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

```bash
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](#authorization).

#### Exporting Translations

To export your translations, run the following command:

```bash
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:

```php
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:

```bash
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:

```json
{
"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.

---
### 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

- [Sachin Arora](https://github.com/sachnaror)

### License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.