The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Add context to Share button tooltip label translation (#83716)
Anderson4141a3ac679d
diff --git a/frontend/src/metabase/embedding/components/SharingMenu/SharingMenu.tsx b/frontend/src/metabase/embedding/components/SharingMenu/SharingMenu.tsxindex f7a193a06ab..666112bffc2 100644--- a/frontend/src/metabase/embedding/components/SharingMenu/SharingMenu.tsx+++ b/frontend/src/metabase/embedding/components/SharingMenu/SharingMenu.tsx@@ -1,5 +1,5 @@import React, { createContext, useCallback, useContext, useState } from "react";-import { t } from "ttag";+import { c } from "ttag";import { ToolbarButton } from "metabase/common/components/ToolbarButton";import { Group, Menu } from "metabase/ui";@@ -11,6 +11,12 @@ export function useCloseSharingMenu() {return useContext(SharingMenuCloseContext);}+function getShareLabel() {+ return c(+ "A verb, not a noun. The label of the button that opens the options to share a question or a dashboard.",+ ).t`Share`;+}+export function SharingMenu({actions,children,@@ -35,8 +41,8 @@ export function SharingMenu({<ToolbarButtonicon="share"data-testid="sharing-menu-button"- tooltipLabel={t`Share`}- aria-label={t`Share`}+ tooltipLabel={getShareLabel()}+ aria-label={getShareLabel()}disabled={!hasActions && !hasMenuItems}/></Menu.Target>@@ -72,11 +78,11 @@ export function SharingButton({<ToolbarButtonicon="share"data-testid="sharing-menu-button"- tooltipLabel={tooltip ?? t`Share`}+ tooltipLabel={tooltip ?? getShareLabel()}// aria-label must be a string; keep the accessible name stable when the// tooltip is a non-string node (e.g. the copied-confirmation flash)aria-label={- ariaLabel ?? (typeof tooltip === "string" ? tooltip : t`Share`)+ ariaLabel ?? (typeof tooltip === "string" ? tooltip : getShareLabel())}onClick={onClick}/>