vovacorgo/laravel-filament-chained-translation-manager
Composer 安装命令:
composer require vovacorgo/laravel-filament-chained-translation-manager
包简介
A translation manager tool for Laravel Filament, that makes use of the Laravel Chained Translator.
README 文档
README
Laravel Filament Chained Translation Manager
The Laravel Filament Chained Translation Manager allows you to easily edit the translations of your current Laravel environment. This translation manager uses the Laravel Chained Translator, that enables you to override the default translations with translations for a specific environment, e.g. a content manager can independently edit and override the translation files on the production environment from the translations provided by the developers.
Typically, at some point during the development phase, a content manager wants to translate or finetune the translation strings added by developers. This often results in merge and versioning issues, when developers and content managers are working on the translation files at the same time.
The Chained Translator package allows translations created by developers to exist separately from translations edited by the content manager in separate lang directories. The library merges the translations of both language directories, where the translations of the content manager (the custom translations) override those of the developer (the default translations). Check the documentation of the Laravel Chained Translator for more info.
There is also a Laravel Nova Chained Translation Manager of this package.
Features
- Save translations of the current environment to separate translation files in a separate language directory to avoid version conflicts.
- Immediately save translations.
- Search for translations and translation keys.
- Filter translations for specific groups and languages.
- Only show keys with missing translations.
- Shows statistics of how many fields are completely translated.
This tool does not provide features to add new translation keys, because our target users are translators and content managers, and we want to avoid that they add unnecessary translation keys.
Installation
Note For Filament 2.x use v1.x version
- You can install the package via Composer:
composer require statikbe/laravel-filament-chained-translation-manager
- Register the plugin for the Filament Panels you want:
public function panel(Panel $panel): Panel { return $panel ->plugins([ \Statikbe\FilamentTranslationManager\FilamentChainedTranslationManagerPlugin::make(), ]); }
- Using this package requires a Filament custom theme. If you do not have one already, you can follow the instructions on the Filament documentation site to create one. Creating a new theme simply publishes the styling for the default Filament panel, so this will not change anything if you are happy with how Filament is styled out of the box. After creating a custom theme, you will need to add the following path to the
contentarray of the generatedtailwind.config.jsfile for the Filament theme:
"./vendor/statikbe/laravel-filament-chained-translation-manager/**/*.blade.php",
- Now run the following command to compile the plugin styles into Filament's stylesheet:
npm run build
- Publish the
configfile then setup your configuration:
php artisan vendor:publish --tag="filament-translation-manager-config"
Configuration
You can configure the custom language directory name and extend or finetune the service provider of the Laravel Chained Translator. Have a look at the configuration options of the Laravel Chained Translator library.
Supported locales
There are two ways to change the supported locales.
Option 1
Set up the supported locales using the configuration. By default, it will fallback to the locale and fallback locale. However, you can customize the configuration to include additional locales as follows:
'locales' => [ 'en', 'fr', ],
Option 2
If your application already has a config that declares your locales than you are able to set the supported locales in any service provider.
Create a new one or use the app/Providers/AppServiceProvider.php and set the supported locales as an array in the boot function as follows:
use Statikbe\FilamentTranslationManager\FilamentTranslationManager; public function boot() { FilamentTranslationManager::setLocales(['en', 'nl']); }
Gate
You can restrict access to the Translation Manager by configuring the Gate variable.
'gate' => 'view-filament-translation-manager',
Ignoring groups
You can choose to exclude specific groups of translations from appearing in Filament. Create an array with the keys that you wish to ignore:
'ignore_groups' => [ 'auth', ],
Navigation Icon
You can customize the navigation icon by configuring the navigation-icon variable
'navigation_icon' => 'heroicon-o-language',
Or you can replace the icon with your own custom icon set, by registering a different icon for this icon:
filament-chained-translation-manager::nav-icon.
Usage
The library creates a new directory for the new translations, see Laravel Chained Translator. Check the configuration options of the Laravel Chained Translator package to change this.
Additionally, please note that the Translation Manager is automatically included in the Filament menu.
Merging translations
You can combine the custom translations of the current environment with the default translation files, by running the command provided by the Laravel Chained Translator.
Screenshots
Upgrading
Please see UPGRADING for details.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
vovacorgo/laravel-filament-chained-translation-manager 适用场景与选型建议
vovacorgo/laravel-filament-chained-translation-manager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 08 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「statikbe」 「laravel-filament-chained-translation-manager」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vovacorgo/laravel-filament-chained-translation-manager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vovacorgo/laravel-filament-chained-translation-manager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vovacorgo/laravel-filament-chained-translation-manager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The Laravel Filament Flexible Content Blocks package helps you to easily create content in Filament for any model, with predefined or custom blocks, and foreach block an extendable Blade view component.
A simple document and image manager for the Filament Flexible Blocks package.
This is a convenience wrapper for the Statik Puppeteer PDF conversion API on AWS Lambda.
Import Surveyhero responses into the Laravel database
Customizable mail templates for Laravel
Alfabank REST API integration
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 33
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-17

