Skip to content

[i18n] Tab::make('Visibility') is hardcoded in FieldForm — bypasses translations #159

Description

@luizboaretto

Summary

vendor/relaticle/custom-fields/src/Filament/Management/Schemas/FieldForm.php:506 uses a hardcoded English string for the Visibility tab label:

$additionalTabs[] = Tab::make('Visibility')
    ->schema([VisibilityComponent::make()]);

Every other tab in the same file goes through __() (e.g. the Validation tab at line 493 uses __('custom-fields::custom-fields.field.form.validation.label')), so this is
the only label that escapes the translation layer in non-English locales.

Steps to reproduce

  1. Install relaticle/custom-fields:^3.1.
  2. Publish translations: php artisan vendor:publish --tag=custom-fields-translations.
  3. Translate lang/vendor/custom-fields//custom-fields.php to a non-English locale (e.g. pt_BR).
  4. Open the field edit modal in the management UI.
  5. Observe: every tab is translated except "Visibility".

Expected

Tab::make receives a translation key, mirroring how the Validation tab is built two blocks above:

$additionalTabs[] = Tab::make(__('custom-fields::custom-fields.visibility.heading'))
    ->schema([VisibilityComponent::make()]);

The key visibility.heading already exists in the English translation file (line 511 of resources/lang/en/custom-fields.php).

Environment

  • Plugin: relaticle/custom-fields v3.1.7
  • Filament: ^5.0
  • Laravel: ^13.7
  • PHP: 8.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions