From 71391f0c71a4e09fe86e393176e104bc6b08704e Mon Sep 17 00:00:00 2001 From: SpiderMan Date: Wed, 2 Mar 2022 14:26:12 -0500 Subject: [PATCH 1/3] fix Line Chart Annotation Info Updage --- .../controls/AnnotationLayerControl/AnnotationLayer.jsx | 4 ++-- superset/translations/zh/LC_MESSAGES/messages.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx index e12ca06cc943c..7f965d68f271f 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx @@ -385,8 +385,8 @@ export default class AnnotationLayer extends React.PureComponent { description = 'Select the Annotation Layer you would like to use.'; } else { label = t('Chart'); - description = `Use a pre defined Superset Chart as a source for annotations and overlays. - your chart must be one of these visualization types: + description = `Use another existing chart as a source for annotations and overlays. + Your chart must be one of these visualization types: [${this.getSupportedSourceTypes(annotationType) .map(x => x.label) .join(', ')}]`; diff --git a/superset/translations/zh/LC_MESSAGES/messages.json b/superset/translations/zh/LC_MESSAGES/messages.json index 035be3ff92762..78f60b15a4031 100644 --- a/superset/translations/zh/LC_MESSAGES/messages.json +++ b/superset/translations/zh/LC_MESSAGES/messages.json @@ -2824,7 +2824,7 @@ "Annotation Source": ["注释来源"], "No options": ["没有选项"], "Superset annotation": ["Superset注释"], - "Use a pre defined Superset Chart as a source for annotations and overlays. your chart must be one of these visualization types:": [ + "Use another existing chart as a source for annotations and overlays. Your chart must be one of these visualization types:": [ "使用预定义的图表作为注释和覆盖的源。图表必须是以下可视化类型之一:" ], "Expects a formula with depending time parameter 'x'\n in milliseconds since epoch. mathjs is used to evaluate the formulas.\n Example: '2x+5'": [ From f9913e89b0bad1c059b7dd73b02cba7e06ef583d Mon Sep 17 00:00:00 2001 From: SpiderMan Date: Tue, 8 Mar 2022 13:00:33 -0500 Subject: [PATCH 2/3] wrap annotation text with transation --- .../AnnotationLayerControl/AnnotationLayer.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx index 7f965d68f271f..82c5fef2c2c9d 100644 --- a/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx +++ b/superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.jsx @@ -385,11 +385,13 @@ export default class AnnotationLayer extends React.PureComponent { description = 'Select the Annotation Layer you would like to use.'; } else { label = t('Chart'); - description = `Use another existing chart as a source for annotations and overlays. - Your chart must be one of these visualization types: - [${this.getSupportedSourceTypes(annotationType) - .map(x => x.label) - .join(', ')}]`; + description = t( + `Use another existing chart as a source for annotations and overlays. + Your chart must be one of these visualization types: [%s]`, + this.getSupportedSourceTypes(annotationType) + .map(x => x.label) + .join(', '), + ); } } else if (annotationType === ANNOTATION_TYPES.FORMULA) { label = 'Formula'; From e2462fcd9c3e506fa3478a3d2254730c39b76c82 Mon Sep 17 00:00:00 2001 From: SpiderMan Date: Fri, 11 Mar 2022 12:48:02 -0500 Subject: [PATCH 3/3] resolve comment --- superset/translations/zh/LC_MESSAGES/messages.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superset/translations/zh/LC_MESSAGES/messages.json b/superset/translations/zh/LC_MESSAGES/messages.json index 78f60b15a4031..7138584f20803 100644 --- a/superset/translations/zh/LC_MESSAGES/messages.json +++ b/superset/translations/zh/LC_MESSAGES/messages.json @@ -2824,8 +2824,8 @@ "Annotation Source": ["注释来源"], "No options": ["没有选项"], "Superset annotation": ["Superset注释"], - "Use another existing chart as a source for annotations and overlays. Your chart must be one of these visualization types:": [ - "使用预定义的图表作为注释和覆盖的源。图表必须是以下可视化类型之一:" + "Use another existing chart as a source for annotations and overlays. Your chart must be one of these visualization types: [%s]": [ + "使用预定义的图表作为注释和覆盖的源。图表必须是以下可视化类型之一: [%s]" ], "Expects a formula with depending time parameter 'x'\n in milliseconds since epoch. mathjs is used to evaluate the formulas.\n Example: '2x+5'": [ "需要一个从Epoch(1970年1月1日00:00:00 UTC)时间点开始的时间参数“x”,并以此来计算的公式(以毫秒为单位)。我们使用“mathjs”来进行公式的计算。例如:'2x+5'"