Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support partial i18n in dashboard #8660

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

sissbruecker
Copy link
Contributor

Description

Adds support for partial I18N objects to dashboard. This allows setting an I18N object that only overrides some of the translations and uses default translations as fallback.

Type of change

  • Feature

const i18n = getDefaultI18n();
return {
selectSection: i18n.selectSection,
remove: i18n.remove,
move: i18n.move,
moveApply: i18n.moveApply,
moveForward: i18n.moveForward,
moveBackward: i18n.moveBackward,
};
return getDefaultI18n();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtering for properties that the component uses doesn't bring much benefit, and is overridden when the dashboard element sets the i18n object on its children.

@@ -217,7 +218,7 @@ export interface DashboardI18n {
* @fires {CustomEvent} dashboard-item-resize-mode-changed - Fired when an item resize mode changed
*/
declare class Dashboard<TItem extends DashboardItem = DashboardItem> extends DashboardLayoutMixin(
ElementMixin(ThemableMixin(HTMLElement)),
I18nMixin({} as DashboardI18n, ElementMixin(ThemableMixin(HTMLElement))),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the way the Dashboard class is defined, applying the I18nMixin required some creativity.

@sissbruecker sissbruecker merged commit 8de8fd4 into main Feb 11, 2025
9 checks passed
@sissbruecker sissbruecker deleted the feat/dashboard-partial-i18n branch February 11, 2025 13:28
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.7.0.alpha10 and is also targeting the upcoming stable 24.7.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants