marshmallow/translatable 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

marshmallow/translatable

最新稳定版本:5.1.7

Composer 安装命令:

composer require marshmallow/translatable

包简介

Add translation to your Nova Resources. The translations will be stored in a translatables table and not in a JSON format in your existing tables as many packages out there do.

README 文档

README

alt text

Nova Translatable

Version Issues Code Coverage Licence

Add translation to your Nova Resources. The translations will be stored in a translatables table and not in a JSON format in your existing tables as many packages out there do.

Installation

You can install the package via composer:

composer require marshmallow/translatable

Publish configuration and assets

php artisan vendor:publish --provider="Marshmallow\Translatable\ServiceProvider"

Run the install command

php artisan translatable:install

Manual Installation

If you prefer to install manually or the automatic installation doesn't work for your setup, follow these steps:

1. Add Default Locale Configuration

Add the following line to your config/app.php file, right after the 'locale' configuration:

'locale' => env('APP_LOCALE', 'en'),

'default_locale' => env('APP_LOCALE'),

2. Set Environment Variable

Make sure you have the APP_LOCALE environment variable set in your .env file:

APP_LOCALE=en

3. Run Migration and Synchronization Commands

# Sync existing translation files to database
php artisan translatable:sync-file-to-database

# Sync missing translations
php artisan translatable:sync-missing

# Generate Nova resources (if using Laravel Nova)
php artisan marshmallow:resource Language Translatable --force
php artisan marshmallow:resource Translation Translatable --force

Usage

Please reference the official documentation at Marshmallow Documentation

Use Deepl integration

This package contains an integration with Deepl. This integration will add a button to the translations index view, that will automaticly translate your text via Deepl. Just add the following ENV variable to use this awesome feature.

TRANSLATABLE_DEEPL_API_KEY=

This will use the free version of the Deepl API. If you have a paid subscription, you can add the following as well.

TRANSLATABLE_DEEPL_API_PATH=https://api.deepl.com

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

composer test

Security

If you discover any security related issues, please email stef@marshmallow.dev instead of using the issue tracker.

Credits

License

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

统计信息

  • 总下载量: 13.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-07