diff --git a/superset/assets/src/SqlLab/components/LimitControl.jsx b/superset/assets/src/SqlLab/components/LimitControl.jsx index 2c5d3b28dc..7b9734ba33 100644 --- a/superset/assets/src/SqlLab/components/LimitControl.jsx +++ b/superset/assets/src/SqlLab/components/LimitControl.jsx @@ -76,8 +76,8 @@ export default class LimitControl extends React.PureComponent { renderPopover() { const textValue = this.state.textValue; const isValid = this.isValidLimit(textValue); - const errorMsg = 'Row limit must be positive integer' + - (this.props.maxRow ? ` and not greater than ${this.props.maxRow}` : ''); + const errorMsg = t('Row limit must be positive integer') + + (this.props.maxRow ? t(' and not greater than %s', this.props.maxRow) : ''); return (
diff --git a/superset/assets/src/SqlLab/components/ResultSet.jsx b/superset/assets/src/SqlLab/components/ResultSet.jsx index 2e8c1d0e2c..22b6b0d46d 100644 --- a/superset/assets/src/SqlLab/components/ResultSet.jsx +++ b/superset/assets/src/SqlLab/components/ResultSet.jsx @@ -220,7 +220,7 @@ export default class ResultSet extends React.PureComponent { ); } else if (data && data.length === 0) { - return The query returned no data; + return {t('The query returned no data')}; } } if (query.cached) { diff --git a/superset/assets/src/SqlLab/components/ShareSqlLabQuery.jsx b/superset/assets/src/SqlLab/components/ShareSqlLabQuery.jsx index be0fdd5b41..dce572ecea 100644 --- a/superset/assets/src/SqlLab/components/ShareSqlLabQuery.jsx +++ b/superset/assets/src/SqlLab/components/ShareSqlLabQuery.jsx @@ -42,7 +42,7 @@ class ShareSqlLabQuery extends React.Component { constructor(props) { super(props); this.state = { - shortUrl: 'Loading ...', + shortUrl: t('Loading ...'), showOverlay: false, }; this.getCopyUrl = this.getCopyUrl.bind(this); @@ -69,7 +69,7 @@ class ShareSqlLabQuery extends React.Component { return ( } /> diff --git a/superset/assets/src/SqlLab/components/SqlEditor.jsx b/superset/assets/src/SqlLab/components/SqlEditor.jsx index fdb7d45ee3..960a4af15e 100644 --- a/superset/assets/src/SqlLab/components/SqlEditor.jsx +++ b/superset/assets/src/SqlLab/components/SqlEditor.jsx @@ -144,19 +144,19 @@ class SqlEditor extends React.PureComponent { { name: 'runQuery1', key: 'ctrl+r', - descr: 'Run query', + descr: t('Run query'), func: this.runQuery, }, { name: 'runQuery2', key: 'ctrl+enter', - descr: 'Run query', + descr: t('Run query'), func: this.runQuery, }, { name: 'newTab', key: 'ctrl+t', - descr: 'New tab', + descr: t('New tab'), func: () => { this.props.actions.addQueryEditor({ ...this.props.queryEditor, @@ -168,7 +168,7 @@ class SqlEditor extends React.PureComponent { { name: 'stopQuery', key: 'ctrl+x', - descr: 'Stop query', + descr: t('Stop query'), func: this.stopQuery, }, ]; @@ -287,9 +287,9 @@ class SqlEditor extends React.PureComponent { if (this.props.latestQuery && this.props.latestQuery.limit_reached) { const tooltip = ( - It appears that the number of rows in the query results displayed - was limited on the server side to - the {this.props.latestQuery.rows} limit. + {t(`It appears that the number of rows in the query results displayed + was limited on the server side to + the %s limit.`, this.props.latestQuery.rows)} ); limitWarning = ( @@ -341,7 +341,7 @@ class SqlEditor extends React.PureComponent { diff --git a/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx b/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx index 38b1647c66..1ee3e4f3bc 100644 --- a/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx +++ b/superset/assets/src/SqlLab/components/TemplateParamsEditor.jsx @@ -79,11 +79,13 @@ export default class TemplateParamsEditor extends React.Component { renderDoc() { return (

- Assign a set of parameters as JSON below - (example: {'{"my_table": "foo"}'}), - and they become available - in your SQL (example: SELECT * FROM {'{{ my_table }}'} ) - by using  + {t('Assign a set of parameters as')} + JSON + {t('below (example:')} + {'{"my_table": "foo"}'} + {t('), and they become available in your SQL (example:')} + SELECT * FROM {'{{ my_table }}'} + {t(') by using')}