Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Plugin Translatable Inline Laravel Package

parfaitementweb/filament-plugin-translatable-inline

Filament addon for LaraZeus Spatie Translatable that lets you edit translations inline under each field. Makes translatable fields obvious, speeds up editing, and highlights missing locales. Works with Filament v4/v5 via a TranslatableContainer wrapper.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Filament 4/5 Plugin: Designed as a Filament-specific extension, leveraging its form system, resource architecture, and component-based UI. This ensures native integration with Filament’s ecosystem (e.g., widgets, tables, and livewire interactions) without disrupting existing workflows.
  • Spatie Translatable Synergy: Built to extend Laravel Translatable (spatie/laravel-translatable), a battle-tested package for multilingual models. This reduces architectural risk by relying on a mature, widely adopted dependency.
  • Inline Editing Paradigm: Optimizes for developer and editor productivity by embedding translations directly in the form UI, eliminating context-switching. This aligns with Filament’s goal of streamlining admin panel interactions.

Integration Feasibility

  • Low-Coupling Design: Operates as a self-contained plugin, requiring minimal changes to existing Filament resources. Can be selectively enabled per resource without global overrides.
  • Field-Level Control: Supports granular translation configuration (e.g., onlyMainLocaleRequired, requiredLocales), allowing incremental adoption.
  • Compatibility with Filament Ecosystem: Works seamlessly with Filament Forms, Tables, and Widgets, ensuring consistency with other plugins (e.g., Filament Spatie Media Library, Filament Notifications).
  • No Database Schema Changes: Relies entirely on model traits and form components, avoiding migrations or schema alterations.

Technical Risk

  • Dependency on Spatie Translatable: Requires spatie/laravel-translatable (v3.x+), which may introduce refactoring costs if the project uses a custom translation system (e.g., JSON columns, pivot tables). Migration effort depends on existing model structure.
  • Filament 4/5 Strictness: Custom Filament field types or resource macros may need adjustments to work with the plugin’s TranslatableContainer or afterStateUpdated hooks. Testing with edge-case field types (e.g., dynamic components, repeaters) is recommended.
  • Missing Translation Handling: While the plugin visually highlights missing translations, the default fallback behavior (e.g., null values, primary locale fallback) must be explicitly configured in Spatie Translatable to avoid runtime issues.
  • Performance Overhead: Inline editing could introduce minor memory/rendering overhead for forms with many translatable fields (e.g., >50 fields). Benchmarking with production-like datasets is advised.
  • Locale Management Complexity: Projects with dynamic locales (e.g., user-specific languages) or non-standard Spatie configurations (e.g., custom getTranslatableLocales) may require additional setup.

Key Questions

  1. Translation Infrastructure:

    • Is the project already using spatie/laravel-translatable? If not, what is the current translation system (e.g., JSON columns, custom pivot tables), and what is the migration effort to adopt Spatie?
    • Are there custom validation rules for translations that would conflict with the plugin’s onlyMainLocaleRequired or requiredLocales logic?
  2. Filament Customization:

    • Does the project use custom Filament field types, resource macros, or global form overrides that could interfere with the plugin’s TranslatableContainer or afterStateUpdated hooks?
    • Are there existing Filament plugins that modify form behavior (e.g., dynamic fields, conditional logic) which might clash with inline translation rendering?
  3. Locale and Validation:

    • How are missing translations currently handled (e.g., fallback to primary locale, null values)? Does this align with the plugin’s behavior?
    • Are there locale-specific validation rules (e.g., regex patterns for certain languages) that need to be preserved or adapted?
  4. Edge Cases and Scaling:

    • How will the plugin handle nested translatable relationships (e.g., translating fields in a hasMany or belongsToMany context)?
    • Are there performance concerns with large forms (e.g., >100 fields), and has the plugin been tested under such conditions?
  5. Testing and QA:

    • What automated tests (if any) exist for translation workflows, and how will they need to be updated to include inline editing?
    • Are there manual QA processes for multilingual content that would need to adapt to the new inline UI?

Integration Approach

Stack Fit

  • Primary Fit: Filament 4/5 admin panels where multilingual content editing is a core requirement but not the primary focus (e.g., CMS platforms, e-commerce backends, localization-heavy SaaS products).
  • Secondary Fit: Complements other Filament plugins to create a unified translation workflow, such as:
    • Filament Tables: Displaying translations inline in list views.
    • Filament Forms: Seamless editing of translatable fields.
    • Filament Notifications: Localized error/success messages.
  • Non-Fit Scenarios:
    • Projects not using Filament 4/5 (requires migration or alternative solutions like custom Livewire components).
    • Applications requiring advanced translation features (e.g., machine translation APIs, collaborative editing, or translation memory tools).
    • Public-facing translation tools (this plugin is admin-focused).

Migration Path

  1. Prerequisite Validation:
    • Confirm Filament 4/5 and PHP 8.1+ compatibility.
    • Audit existing translation logic to assess Spatie Translatable migration effort (if not already adopted).
  2. Dependency Installation:
    composer require lara-zeus/spatie-translatable parfaitementweb/filament-plugin-translatable-inline:"^4.0"
    
  3. Configuration:
    • Publish and configure spatie/laravel-translatable (if migrating):
      php artisan vendor:publish --provider="Spatie\Translatable\TranslatableServiceProvider"
      
    • Register the plugin in app/Providers/FilamentPluginServiceProvider.php:
      Filament::registerPlugin(
          Parfaitementweb\FilamentPluginTranslatableInline\FilamentPluginTranslatableInlinePlugin::make()
      );
      
  4. Resource Integration:
    • Replace existing translatable fields with the plugin’s TranslatableContainer:
      use Parfaitementweb\FilamentPluginTranslatableInline\Forms\Components\TranslatableContainer;
      
      public static function form(Form $form): Form
      {
          return $form->schema([
              TranslatableContainer::make(
                  TextInput::make('title')
                      ->required()
                      ->maxLength(255)
              )
              ->onlyMainLocaleRequired()
              ->requiredLocales(['en', 'es']),
          ]);
      }
      
    • For existing Spatie Translatable models, ensure the Translatable trait is applied to the model (not Filament resources).
  5. Testing:
    • Validate inline editing for single and batch translatable fields.
    • Test locale switching, missing translation handling, and form validation.
    • Verify compatibility with custom field types and nested relationships.

Compatibility

  • Filament 4/5 Core: Fully compatible with Filament’s form system, livewire components, and widgets. Supports Filament 5’s blade icons and inline styling.
  • Spatie Translatable: Works with all Spatie Translatable features, including:
    • Custom locale resolution (getTranslatableLocales).
    • Fallback locales.
    • JSON-based translation storage.
  • Other Filament Plugins: No known conflicts with Filament Spatie Media Library, Filament Actions, or Filament Notifications. However, custom plugins may require testing.
  • Legacy Systems: Not compatible with Filament 3 or Nova. Requires Filament 4/5 migration if not already adopted.

Sequencing

  1. Phase 1: Proof of Concept (1–2 weeks)

    • Install the plugin and Spatie Translatable.
    • Integrate with one Filament resource (e.g., a Page or Product model).
    • Test inline editing for 2–3 translatable fields.
    • Validate performance and UI consistency.
  2. Phase 2: Incremental Rollout (2–4 weeks)

    • Migrate additional resources to use TranslatableContainer.
    • Configure locale-specific validation and fallback rules.
    • Test with nested relationships (if applicable).
    • Update automated tests to include translation workflows.
  3. Phase 3: Optimization and Polishing (1–2 weeks)

    • Address any edge cases (e.g., dynamic locales, custom field types).
    • Optimize form rendering performance if needed.
    • Document new translation workflows for the team.

Operational Impact

Maintenance

  • Low Maintenance Overhead: The plugin is self-contained and follows Filament’s conventions
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky