From a84873a52bfb1a89e4174ec6f0fa62d88dbfa01d Mon Sep 17 00:00:00 2001 From: Joao Silva <100691367+JoaoSilvaGrafana@users.noreply.github.com> Date: Thu, 4 Aug 2022 16:43:49 +0100 Subject: [PATCH] i18n: Translates the Share Panel modal (#53297) --- .../core/components/Select/FolderPicker.tsx | 3 +- .../components/ShareModal/ShareEmbed.tsx | 42 +++--- .../ShareModal/ShareLibraryPanel.tsx | 5 +- .../components/ShareModal/ShareLink.tsx | 37 +----- .../components/ShareModal/ShareModal.tsx | 26 +++- .../components/ShareModal/ThemePicker.tsx | 47 +++++++ .../AddLibraryPanelModal.tsx | 21 ++- .../library-panels/utils/usePanelSave.ts | 18 ++- public/locales/en-US/messages.po | 124 +++++++++++++++--- public/locales/es-ES/messages.po | 124 +++++++++++++++--- public/locales/fr-FR/messages.po | 124 +++++++++++++++--- public/locales/pseudo-LOCALE/messages.po | 124 +++++++++++++++--- 12 files changed, 564 insertions(+), 131 deletions(-) create mode 100644 public/app/features/dashboard/components/ShareModal/ThemePicker.tsx diff --git a/public/app/core/components/Select/FolderPicker.tsx b/public/app/core/components/Select/FolderPicker.tsx index 99380c613af..20a584061ad 100644 --- a/public/app/core/components/Select/FolderPicker.tsx +++ b/public/app/core/components/Select/FolderPicker.tsx @@ -1,3 +1,4 @@ +import { t } from '@lingui/macro'; import { debounce } from 'lodash'; import React, { PureComponent } from 'react'; @@ -218,7 +219,7 @@ export class FolderPicker extends PureComponent { > = [ - { label: 'Current', value: 'current' }, - { label: 'Dark', value: 'dark' }, - { label: 'Light', value: 'light' }, -]; - interface Props extends ShareModalTabProps {} interface State { @@ -69,12 +64,21 @@ export class ShareEmbed extends PureComponent { const { useCurrentTimeRange, selectedTheme, iframeHtml } = this.state; const isRelativeTime = this.props.dashboard ? this.props.dashboard.time.to === 'now' : false; + const timeRangeDescription = isRelativeTime + ? t({ + id: 'share-modal.embed.time-range-description', + message: 'Transforms the current relative time range to an absolute time range', + }) + : ''; + return ( <> -

Generate HTML for embedding an iframe with this panel.

+

+ Generate HTML for embedding an iframe with this panel. +

{ onChange={this.onUseCurrentTimeRangeChange} /> - - - + + The HTML code below can be pasted and included in another web page. Unless anonymous access is enabled, + the user viewing that page need to be signed into Grafana for the graph to load. + + } >