Translatable Tabs plugin screenshot
Dark mode ready
Multilingual support
Supports v5.x

Translatable Tabs

Community

Automatically generate tabs for translations.

Tags: Forms Form Field Spatie Integration
Supported versions:
5.x 4.x 3.x
Abdulmajeed Jamaan avatar Author: Abdulmajeed Jamaan

Package health

Beta

Automated checks of this plugin's Composer package

73 / 100
Security 58
Maintenance 88
Ecosystem 100
15 checks
  • Failed: GitHub Actions pinned to SHA View details on Plumb
  • Skipped: GitLab CI includes pinned to SHA
  • Passed: Open security advisories
  • Warning: Dependabot PR responsiveness — Stale Dependabot PRs: oldest general PR is 34 days old.
  • Skipped: Renovate MR responsiveness
  • Warning: Dependabot or Renovate configured — Updater does not cover the JavaScript ecosystem, which has a committed lockfile.
  • Failed: Dependency update cooldown configured No cooldown configured in .github/dependabot.yml. View details on Plumb
  • Passed: Provides a security policy
  • Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
  • Warning: Commit and release recency — Low activity: last commit 97 days ago; last release 184 days ago.
  • Passed: composer.lock not committed by library composer.lock is absent from the released dist archive.
  • Passed: Dist archive is lean
  • Passed: Current Laravel version supported — Package dependencies resolve together with current Laravel 13.0.
  • Passed: Current PHP version supported — No PHP constraint declared; package imposes no version restriction.
  • Skipped: Current Symfony version supported
Third-party plugin. This is built by the community, not the Filament team. Filament does not review, endorse, or vet the security of plugins outside the filament/ namespace. Review the source and install at your own risk. Found malware or an unresolved security issue the author won't address? Report it .
Powered by Plumb Last scanned 4 days ago

Documentation

Version:

This package inspired by this filament-translatable-fields, but allowing filament like customizability on the Tabs and Fields components in context of each locale.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Automatically generate tabs for translations.

Works seamlessly with spatie/laravel-translatable, lara-zeus/translatable-pro, but it can be used standalone as well.

Preview

Preview

#Supported Filament versions

Filament Version Filament Translatable Tabs Version
^3.x ^3.x
^4.x ^4.x
^5.x ^5.x

#Installation

You can install the package via composer:

composer require abdulmajeed-jamaan/filament-translatable-tabs

Then in any registered service provider boot() method configure the following:

TranslatableTabs::configureUsing(function (TranslatableTabs $component) {
    $component
        // locales labels
        ->localesLabels([
            'ar' => __('locales.ar'),
            'en' => __('locales.en')
        ])
        // default locales
        ->locales(['ar', 'en']);
});

#Usage

// Single Field
TextInput::make('title')
    ->translatableTabs();

// Multiple Fields
TranslatableTabs::make('anyLabel')
    ->schema([
        Forms\Components\TextInput::make("title"),
        Forms\Components\Textarea::make("content")
    ]);

#Customizations

You can customize Tab and Field based on locale using the following methods:

use AbdulmajeedJamaan\FilamentTranslatableTabs\TranslatableTabs;
use AbdulmajeedJamaan\FilamentTranslatableTabs\TranslatableTab;
use Filament\Forms\Components\Field;

$customizeTab = function (TranslatableTab $component, string $locale) {
    // ...
};

$customizeField = function (Field $component, string $locale) {
    // ...
};

// Globally in boot method
TranslatableTabs::configureUsing(function (TranslatableTabs $component) {
    $component
        ->modifyTabsUsing($customizeTab)
        ->modifyFieldsUsing($customizeField);
});

// Single Field
TextInput::make()
    ->translatableTabs()
    ->modifyTabsUsing($customizeTab)
    ->modifyFieldsUsing($customizeField)

// Multiple Fields
TranslatableTabs::make('anyLabel')
    ->modifyTabsUsing($customizeTab)
    ->modifyFieldsUsing($customizeField)
    ->schema([
        Forms\Components\TextInput::make("title"),
        Forms\Components\Textarea::make("content")
    ]);

#Override the default locale

You can add the method locale to change it on the fly:

$localesFn = function () {
    return ['ar', 'en'];
    
    // also you can override label using:
    return [
        'ar' => 'Arabic',
        'en' => 'English'
    ]
}
// Single Field
TextInput::make('title')
    ->translatableTabs()
    ->locales($localesFn);

// Multiple Fields
TranslatableTabs::make('anyLabel')
    ->locales($localesFn)
    ->schema([
        Forms\Components\TextInput::make("title"),
        Forms\Components\Textarea::make("content")
    ]);

#Pre made configurations

In order to have similar experience to the preview set the following:

TranslatableTabs::configureUsing(function (TranslatableTabs $component) {
    $component
        ->addDirectionByLocale()
        ->addEmptyBadgeWhenAllFieldsAreEmpty(emptyLabel: __('locales.empty'))
        ->addSetActiveTabThatHasValue();
});

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

The author

Abdulmajeed Jamaan avatar Author: Abdulmajeed Jamaan

I thrive on work that positively impacts people's lives.

Plugins
1
Stars
50