Skip to content

Commit

Permalink
make some text in [druid,CRUD,datasource] localizable (#5796)
Browse files Browse the repository at this point in the history
  • Loading branch information
hitdemo authored and mistercrunch committed Sep 4, 2018
1 parent 77fe9ef commit d43813f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion superset/assets/src/CRUD/CollectionTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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>
Expand Down
10 changes: 5 additions & 5 deletions superset/assets/src/datasource/DatasourceEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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={{
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/src/datasource/DatasourceModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions superset/connectors/druid/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ def refresh(self, datasource_names, merge_flag, refreshAll):
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
Expand Down
4 changes: 2 additions & 2 deletions superset/connectors/druid/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ def refresh_datasources(self, refreshAll=True):
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/')
Expand Down

0 comments on commit d43813f

Please sign in to comment.