Class DefaultTranslationsHotswapper

java.lang.Object
com.vaadin.base.devserver.hotswap.impl.DefaultTranslationsHotswapper
All Implemented Interfaces:
VaadinHotswapper

public class DefaultTranslationsHotswapper extends Object implements VaadinHotswapper
Handles the automatic hotswapping of translation resources in a Vaadin-based application. This class listens for changes in application resources and takes appropriate actions to update related translations dynamically.

When a resource file matching the path pattern for translation properties (e.g., `vaadin-i18n/*.properties`) is changed, this class performs two main actions: 1. Clears the ResourceBundle cache to ensure the latest translations are loaded. 2. Notifies the client about the translation updates by triggering an appropriate update event and UI refreshes.

For internal use only. May be renamed or removed in a future release.

Since:
25.0
  • Constructor Details

    • DefaultTranslationsHotswapper

      public DefaultTranslationsHotswapper()
  • Method Details

    • onResourcesChange

      public void onResourcesChange(HotswapResourceEvent event)
      Description copied from interface: VaadinHotswapper
      Called by Vaadin hotswap entry point when one or more application resources have been updated.

      This method is meant to perform application-wide updates, involving all active UI instances.

      Specified by:
      onResourcesChange in interface VaadinHotswapper
      Parameters:
      event - the event instance carrying the information about the changed resources.