Skip to content

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

Description

@yazdanghalavand

On the product Variants management screen (ProductOptionsWidget + resources/views/resources/product-resource/widgets/product-options.blade.php), three strings always render in English even when the app locale and lunarpanel translations are set to another language (reproduced with APP_LOCALE=tr):

  1. "Add shared option" button — addSharedOptionAction() calls Action::make('addSharedOption') without ->label(), so Filament humanises the action name. The key lunarpanel::productoption.widgets.product-options.actions.add-shared-option.label exists and is translated in the shipped locales, but it is never applied to the action.
  2. "Save variants" button — saveVariantsAction() calls Action::make('saveVariants') without ->label(). There is no save-variants.label key at all (only a notifications.save-variants.success.title).
  3. "No Product Options Configured" empty state — hardcoded in the Blade view: <x-filament-tables::empty-state heading="No Product Options Configured" ...>, bypassing translations. The sibling variants-table empty state on the same view already uses a translation key (variants-table.empty.heading).

Version

  • lunarphp/lunar 1.3.0

To reproduce

  1. Set the panel to a non-English locale (e.g. APP_LOCALE=tr) with lunarpanel translations present.
  2. Open any product → Variants → Configure Options.
  3. The "Add shared option" and "Save variants" buttons, and the "No Product Options Configured" empty state, render in English while the rest of the widget is translated.

Expected

All three strings use the lunarpanel translations like the rest of the widget.

Suggested fix

  • Add ->label(__('lunarpanel::productoption.widgets.product-options.actions.add-shared-option.label')) to the addSharedOption action.
  • Add a save-variants.label key to resources/lang/*/productoption.php and apply it to the saveVariants action.
  • Route the hardcoded empty-state heading through a translation key (e.g. reuse options-list.empty.heading).

Happy to open a PR if that would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions