Skip to content

Translate product-variants widget labels#2555

Open
yazdanghalavand wants to merge 1 commit into
lunarphp:1.xfrom
yazdanghalavand:fix/panel-variant-labels-i18n
Open

Translate product-variants widget labels#2555
yazdanghalavand wants to merge 1 commit into
lunarphp:1.xfrom
yazdanghalavand:fix/panel-variant-labels-i18n

Conversation

@yazdanghalavand

Copy link
Copy Markdown

Fixes #2554.

Three strings on the product Variants screen rendered in English regardless of locale:

  • "Add shared option" and "Save variants" actions had no ->label(), so Filament humanised the action names.
  • "No Product Options Configured" was hardcoded in the Blade view, while the two sibling empty states on the same view already use translation keys.

Changes

  • ProductOptionsWidget — apply the existing add-shared-option.label key to the addSharedOption action, and a new save-variants.label key to the saveVariants action.
  • lang/en/productoption.php — add the save-variants.label key (Save Variants). Other locales fall back to English until translated.
  • product-options.blade.php — route the hardcoded empty-state heading through options-list.empty.heading.

No behaviour change beyond localisation; verified in a Turkish-locale panel that all three now translate.

The "Add shared option" and "Save variants" actions and the "No Product
Options Configured" empty state rendered in English regardless of locale:
the two actions had no ->label() so Filament humanised their names, and the
empty-state heading was hardcoded in the Blade view.

Apply the existing add-shared-option translation key to its action, add a
save-variants label key and apply it, and route the hardcoded heading
through options-list.empty.heading (the sibling empty states already use
translation keys).

Fixes lunarphp#2554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

[Panel] Product-variants widget renders three strings in English regardless of locale

1 participant