From 3a7a35f0e7dd38d449ade1d09a96ddcb43cf9700 Mon Sep 17 00:00:00 2001 From: Corey Robertson Date: Tue, 30 Jun 2020 11:38:53 -0400 Subject: [PATCH] i18n --- x-pack/plugins/canvas/i18n/components.ts | 7 +++++++ .../canvas/public/components/workpad_templates/index.tsx | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/canvas/i18n/components.ts b/x-pack/plugins/canvas/i18n/components.ts index 0b512c80b209b..8acda5da4f0d2 100644 --- a/x-pack/plugins/canvas/i18n/components.ts +++ b/x-pack/plugins/canvas/i18n/components.ts @@ -1604,5 +1604,12 @@ export const ComponentStrings = { i18n.translate('xpack.canvas.workpadTemplate.searchPlaceholder', { defaultMessage: 'Find template', }), + getCreatingTemplateLabel: (templateName: string) => + i18n.translate('xpack.canvas.workpadTemplate.creatingTemplateLabel', { + defaultMessage: `Creating from template '{templateName}'`, + values: { + templateName, + }, + }), }, }; diff --git a/x-pack/plugins/canvas/public/components/workpad_templates/index.tsx b/x-pack/plugins/canvas/public/components/workpad_templates/index.tsx index b04e5f8b28908..f35bba3fd598d 100644 --- a/x-pack/plugins/canvas/public/components/workpad_templates/index.tsx +++ b/x-pack/plugins/canvas/public/components/workpad_templates/index.tsx @@ -7,6 +7,7 @@ import React, { useContext, useState, useEffect, FunctionComponent } from 'react'; import { EuiLoadingSpinner } from '@elastic/eui'; import { RouterContext } from '../router'; +import { ComponentStrings } from '../../../i18n/components'; // @ts-expect-error import * as workpadService from '../../lib/workpad_service'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; @@ -22,7 +23,8 @@ interface WorkpadTemplatesProps { const Creating: FunctionComponent<{ name: string }> = ({ name }) => (
- Creating from template {name} + {' '} + {ComponentStrings.WorkpadTemplates.getCreatingTemplateLabel(name)}
); export const WorkpadTemplates: FunctionComponent = ({ onClose }) => {