You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/09/04 06:04:33 UTC
[incubator-superset] branch master updated: make some text in
[druid, CRUD, datasource] localizable (#5796)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new d43813f make some text in [druid,CRUD,datasource] localizable (#5796)
d43813f is described below
commit d43813ff09e4878e6fa964c87ce8b29b38b4597d
Author: hitdemo <hi...@gmail.com>
AuthorDate: Tue Sep 4 14:04:31 2018 +0800
make some text in [druid,CRUD,datasource] localizable (#5796)
---
superset/assets/src/CRUD/CollectionTable.jsx | 4 +++-
superset/assets/src/datasource/DatasourceEditor.jsx | 10 +++++-----
superset/assets/src/datasource/DatasourceModal.jsx | 2 +-
superset/connectors/druid/models.py | 4 ++--
superset/connectors/druid/views.py | 4 ++--
5 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/superset/assets/src/CRUD/CollectionTable.jsx b/superset/assets/src/CRUD/CollectionTable.jsx
index 2cbc132..514f866 100644
--- a/superset/assets/src/CRUD/CollectionTable.jsx
+++ b/superset/assets/src/CRUD/CollectionTable.jsx
@@ -7,6 +7,8 @@ import Fieldset from './Fieldset';
import { recurseReactClone } from './utils';
import './styles.css';
+import { t } from '../locales';
+
const propTypes = {
collection: PropTypes.arrayOf(PropTypes.object).isRequired,
itemGenerator: PropTypes.func,
@@ -210,7 +212,7 @@ export default class CRUDCollection extends React.PureComponent {
<div>
{this.props.allowAddItem &&
<Button bsStyle="primary" onClick={this.onAddItem}>
- <i className="fa fa-plus" /> Add Item
+ <i className="fa fa-plus" /> {t('Add Item')}
</Button>}
{this.props.extraButtons}
</div>
diff --git a/superset/assets/src/datasource/DatasourceEditor.jsx b/superset/assets/src/datasource/DatasourceEditor.jsx
index e57df88..48c2401 100644
--- a/superset/assets/src/datasource/DatasourceEditor.jsx
+++ b/superset/assets/src/datasource/DatasourceEditor.jsx
@@ -110,11 +110,11 @@ function ColumnCollectionTable({
</FormContainer>
}
columnLabels={{
- column_name: 'Column',
- type: 'Data Type',
- groupby: 'Is Dimension',
- is_dttm: 'Is Temporal',
- filterable: 'Is Filterable',
+ column_name: t('Column'),
+ type: t('Data Type'),
+ groupby: t('Is Dimension'),
+ is_dttm: t('Is Temporal'),
+ filterable: t('Is Filterable'),
}}
onChange={onChange}
itemRenderers={{
diff --git a/superset/assets/src/datasource/DatasourceModal.jsx b/superset/assets/src/datasource/DatasourceModal.jsx
index 690dc8e..2f3dbdc 100644
--- a/superset/assets/src/datasource/DatasourceModal.jsx
+++ b/superset/assets/src/datasource/DatasourceModal.jsx
@@ -46,7 +46,7 @@ class DatasourceModal extends React.PureComponent {
}
onClickSave() {
this.dialog.show({
- title: 'Confirm save',
+ title: t('Confirm save'),
bsSize: 'medium',
actions: [
Dialog.CancelAction(),
diff --git a/superset/connectors/druid/models.py b/superset/connectors/druid/models.py
index 23b0b73..e318fc3 100644
--- a/superset/connectors/druid/models.py
+++ b/superset/connectors/druid/models.py
@@ -187,11 +187,11 @@ class DruidCluster(Model, AuditMixinNullable, ImportMixin):
with session.no_autoflush:
session.add(datasource)
flasher(
- 'Adding new datasource [{}]'.format(ds_name), 'success')
+ _('Adding new datasource [{}]').format(ds_name), 'success')
ds_map[ds_name] = datasource
elif refreshAll:
flasher(
- 'Refreshing datasource [{}]'.format(ds_name), 'info')
+ _('Refreshing datasource [{}]').format(ds_name), 'info')
else:
del ds_map[ds_name]
continue
diff --git a/superset/connectors/druid/views.py b/superset/connectors/druid/views.py
index cc0cea9..d4875f9 100644
--- a/superset/connectors/druid/views.py
+++ b/superset/connectors/druid/views.py
@@ -341,8 +341,8 @@ class Druid(BaseSupersetView):
return redirect('/druidclustermodelview/list/')
cluster.metadata_last_refreshed = datetime.now()
flash(
- 'Refreshed metadata from cluster '
- '[' + cluster.cluster_name + ']',
+ _('Refreshed metadata from cluster [{}]').format(
+ cluster.cluster_name),
'info')
session.commit()
return redirect('/druiddatasourcemodelview/list/')