Home > widget-integration > CartController > getButtonStateTranslations

CartController.getButtonStateTranslations() method

Get button state translations Override to customize button text for different states and locales

Signature:

protected getButtonStateTranslations(): Record<string, string>;

Returns:

Record<string, string>

Object mapping button states to translated text

Example

// Customize for German locale
protected getButtonStateTranslations() {
  return {
    adding: 'Wird hinzugefügt...',
    added: 'Hinzugefügt!',
    failed: 'Fehler!',
    default: 'In den Warenkorb'
  };
}