Localization
The Dreame Vacuum Card natively supports multiple languages. It dynamically uses the language files provided by the backend dreame_vacuum integration rather than maintaining separate localization files.
The card retrieves localized text values from the entity_component section within the dreame_vacuum integration translation files.
Translation Keys
Within the language files, the card primarily uses several key categories starting with frontend_ to display its interface:
frontend_action: This section contains all the text used inside the action buttons on the card's main control panel, such as Start, Pause, or Dock.frontend_config: This section contains all the text labels, descriptions and settings used inside the visual card configurator UI.frontend_message: Contains status messages, alerts, error reports and warnings displayed on the card.frontend_title: Covers the headings and section titles used within the card's menus, such as Map Management or Cleaning Settings.entity: This block covers Home Assistant entity domains such asselect,sensor,switch,number,timeandinput. The card dynamically pulls the names and states of these entities, such as Suction Level or Quiet, directly from the integration to ensure consistency.- Card-Specific States: Provides translations for internal states used exclusively by the card's UI rather than Home Assistant entities. This includes room names (derived from the
segment_nameentity), along with specific identifiers liketask_type,edit_type,map_type,object_type,furniture_type,obstacle_type,obstacle_reason,task_end_type,task_interrupt_reason,startup_method,cleanup_methodandrecovery_map_type.
- Card-Specific States: Provides translations for internal states used exclusively by the card's UI rather than Home Assistant entities. This includes room names (derived from the
Date, Time and Unit Formatting
In addition to text translations, the card automatically adapts to local formatting preferences without requiring any manual configuration:
- Language & Locale: The card prioritizes the language selected in the Home Assistant profile. If no language is explicitly set there, it automatically falls back to the web browser's default language.
- 12/24-Hour Time Format: The card respects the time format configured in the Home Assistant profile. If unspecified, it automatically adopts the standard time format of the device's region.
- First Day of the Week: The card reads the first day of the week setting directly from Home Assistant. If not defined, it dynamically determines whether the calendar should start on Sunday or Monday based on the local region.
- Unit System: The card continuously checks the Home Assistant global configuration. If the system uses the Imperial unit system, the card automatically recalculates areas and distances, natively displaying them in feet, square feet, or yards.
- Native Unit Translations: Common unit suffixes and abbreviations, such as meter, kilometer, foot, yard, minute and hour, do not require any manual translation. The card translates them on the fly using built-in browser features tailored specifically to the active language.
Fix or Improve Translations
If a typo or incorrect translation is identified, or support for a new language is needed, contributions go to the main dreame_vacuum integration repository.
Translation Generalization
The official app frequently uses different terminology for identical parameters across various device generations. Translations must utilize logical, generalized names rather than strictly copying the exact wording from the APP. This prevents translation conflicts where a correction tailored for one specific generation is subsequently overwritten by users with different device generations.
The update process involves the following steps:
- Fork the Repository: Forking the Dreame Vacuum Home Assistant integration repository on GitHub.
- Find the Translation File: Navigating to the
custom_components/dreame_vacuum/translations/directory in the forked repository to locate the translation file matching the language code, such asde.jsonorit.json. - Make the Changes: Updating the incorrect text. The
frontend_action,frontend_config,frontend_message, andfrontend_titleblocks manage UI-related text. Theentityblock manages sensor names, select options, and their states. - Submit a Pull Request: Opening a Pull Request to the main repository. After the Pull Request is reviewed and merged into a new release of the integration, the Dreame Vacuum Card automatically picks up the updated translations.
