pxlrbt/filament-translate-action 问题修复 & 功能扩展

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

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

pxlrbt/filament-translate-action

最新稳定版本:v1.1.0

Composer 安装命令:

composer require pxlrbt/filament-translate-action

包简介

Translate Action for Filament Admin

README 文档

README

header

Filament Translate Action

Latest Version on Packagist Software License GitHub Workflow Status Total Downloads

Translate your models with a single action click via DeepL.

Installation

composer require pxlrbt/filament-translate-action

Usage

Set an API Key

Setup a free account on DeepL. You can get your API key from your account page: https://www.deepl.com/de/account/summary.

Then configure the API key in your AppServiceProvider:

use pxlrbt\FilamentTranslateAction\Filament\Actions\TranslateAction

public function boot(): void
{
    // ...
    TranslateAction::apiKey('your-api-key');
    // ...
}

Use the action

Add the action to the header actions for your page. You can specify the sourceLocale otherwise it will default to en.

class EditUser extends \Filament\Resources\Pages\EditRecord
{
    // ...
    protected function getHeaderActions(): array
    {
        return [
            TranslateAction::make()
                ->sourceLocale('de'),
        ];
    }    
}

Contributing

If you want to contribute to this packages, you may want to test it in a real Filament project:

  • Fork this repository to your GitHub account.
  • Create a Filament app locally.
  • Clone your fork in your Filament app's root directory.
  • In the /filament-translate-action directory, create a branch for your fix, e.g. fix/error-message.

Install the packages in your app's composer.json:

"require": {
    "pxlrbt/filament-translate-action": "dev-fix/error-message as main-dev",
},
"repositories": [
    {
        "type": "path",
        "url": "filament-translate-action"
    }
]

Now, run composer update.

Credits

统计信息

  • 总下载量: 36
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-01