diff --git a/superset/assets/src/dashboard/components/SliceAdder.jsx b/superset/assets/src/dashboard/components/SliceAdder.jsx
index f237a06dd2..31ad79745c 100644
--- a/superset/assets/src/dashboard/components/SliceAdder.jsx
+++ b/superset/assets/src/dashboard/components/SliceAdder.jsx
@@ -12,6 +12,7 @@ import Loading from '../../components/Loading';
import { CHART_TYPE, NEW_COMPONENT_SOURCE_TYPE } from '../util/componentTypes';
import { NEW_CHART_ID, NEW_COMPONENTS_SOURCE_ID } from '../util/constants';
import { slicePropShape } from '../util/propShapes';
+import { t } from '../../locales';
const propTypes = {
fetchAllSlices: PropTypes.func.isRequired,
@@ -204,7 +205,7 @@ class SliceAdder extends React.Component {
View query}
+ triggerNode={{t('View query')}}
modalTitle={t('View query')}
bsSize="large"
beforeOpen={this.beforeOpen}
@@ -152,7 +152,7 @@ export default class DisplayQueryButton extends React.PureComponent {
View results}
+ triggerNode={{t('View results')}}
modalTitle={t('View results')}
bsSize="large"
beforeOpen={this.beforeOpen}
@@ -163,7 +163,7 @@ export default class DisplayQueryButton extends React.PureComponent {
eventKey="3"
onClick={this.redirectSQLLab.bind(this)}
>
- Run in SQL Lab
+ {t('Run in SQL Lab')}
}
);
diff --git a/superset/assets/src/explore/components/controls/AnnotationLayer.jsx b/superset/assets/src/explore/components/controls/AnnotationLayer.jsx
index 6cb2f2d209..9e31e6c856 100644
--- a/superset/assets/src/explore/components/controls/AnnotationLayer.jsx
+++ b/superset/assets/src/explore/components/controls/AnnotationLayer.jsx
@@ -26,6 +26,8 @@ import ControlHeader from '../ControlHeader';
import { nonEmpty } from '../../validators';
import vizTypes from '../../visTypes';
+import { t } from '../../../locales';
+
const AUTOMATIC_COLOR = '';
const propTypes = {
@@ -485,12 +487,12 @@ export default class AnnotationLayer extends React.PureComponent {
{}}
- title="Display configuration"
- info="Configure your how you overlay is displayed here."
+ title={t('Display configuration')}
+ info={t('Configure your how you overlay is displayed here.')}
>
this.setState({ opacity: v })}
/>
-
+
this.setState({ width: v })}
@@ -580,27 +582,27 @@ export default class AnnotationLayer extends React.PureComponent {
{}}
- title="Layer Configuration"
- info="Configure the basics of your Annotation Layer."
+ title={t('Layer Configuration')}
+ info={t('Configure the basics of your Annotation Layer.')}
>
this.setState({ name: v })}
- validationErrors={!name ? ['Mandatory'] : []}
+ validationErrors={!name ? [t('Mandatory')] : []}
/>
this.setState({ show: !v })}
/>
({ value: x, label: getAnnotationTypeLabel(x) }))}
@@ -630,7 +632,7 @@ export default class AnnotationLayer extends React.PureComponent {
bsSize="sm"
onClick={this.deleteAnnotation}
>
- { !isNew ? 'Remove' : 'Cancel' }
+ { !isNew ? t('Remove') : t('Cancel') }
diff --git a/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx b/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
index 3e4cd24e31..b33dab0195 100644
--- a/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
+++ b/superset/assets/src/explore/components/controls/AnnotationLayerControl.jsx
@@ -75,7 +75,7 @@ class AnnotationLayerControl extends React.PureComponent {
return (
Moving Average],
+ [{t('Moving Average')}
],
['rolling_type', 'rolling_periods', 'min_periods'],
- [Time Comparison
],
+ [{t('Time Comparison')}
],
['time_compare', 'comparison_type'],
- [Python Functions
],
+ [{t('Python Functions')}
],
[pandas.resample
],
['resample_how', 'resample_rule', 'resample_fillmethod'],
],
@@ -1833,7 +1833,7 @@ export const visTypes = {
},
partition: {
- label: 'Partition Diagram',
+ label: t('Partition Diagram'),
showOnExplore: true,
controlPanelSections: [
sections.NVD3TimeSeries[0],
diff --git a/superset/connectors/druid/views.py b/superset/connectors/druid/views.py
index 5e5ba0da93..cc0cea9a08 100644
--- a/superset/connectors/druid/views.py
+++ b/superset/connectors/druid/views.py
@@ -56,6 +56,8 @@ class DruidColumnInlineView(CompactCRUDMixin, SupersetModelView): # noqa
'sum': _('Sum'),
'min': _('Min'),
'max': _('Max'),
+ 'verbose_name': _('Verbose Name'),
+ 'description': _('Description'),
}
description_columns = {
'filterable': _(
@@ -137,6 +139,7 @@ class DruidMetricInlineView(CompactCRUDMixin, SupersetModelView): # noqa
'json': _('JSON'),
'datasource': _('Druid Datasource'),
'warning_text': _('Warning Message'),
+ 'is_restricted': _('Is Restricted'),
}
def post_add(self, metric):
@@ -175,6 +178,9 @@ class DruidClusterModelView(SupersetModelView, DeleteMixin, YamlExportMixin): #
'broker_host': _('Broker Host'),
'broker_port': _('Broker Port'),
'broker_endpoint': _('Broker Endpoint'),
+ 'verbose_name': _('Verbose Name'),
+ 'cache_timeout': _('Cache Timeout'),
+ 'metadata_last_refreshed': _('Metadata Last Refreshed'),
}
description_columns = {
'cache_timeout': _(
@@ -272,6 +278,10 @@ class DruidDatasourceModelView(DatasourceModelView, DeleteMixin, YamlExportMixin
'default_endpoint': _('Default Endpoint'),
'offset': _('Time Offset'),
'cache_timeout': _('Cache Timeout'),
+ 'datasource_name': _('Datasource Name'),
+ 'fetch_values_from': _('Fetch Values From'),
+ 'changed_by_': _('Changed By'),
+ 'modified': _('Modified'),
}
def pre_add(self, datasource):
diff --git a/superset/connectors/sqla/views.py b/superset/connectors/sqla/views.py
index 45143616de..2766385d51 100644
--- a/superset/connectors/sqla/views.py
+++ b/superset/connectors/sqla/views.py
@@ -242,6 +242,7 @@ class TableModelView(DatasourceModelView, DeleteMixin, YamlExportMixin): # noqa
'description': _('Description'),
'is_sqllab_view': _('SQL Lab View'),
'template_params': _('Template parameters'),
+ 'modified': _('Modified'),
}
def pre_add(self, table):
diff --git a/superset/views/annotations.py b/superset/views/annotations.py
index e2aaf888da..648be25881 100644
--- a/superset/views/annotations.py
+++ b/superset/views/annotations.py
@@ -7,6 +7,7 @@ from __future__ import unicode_literals
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_babel import gettext as __
+from flask_babel import lazy_gettext as _
from superset import appbuilder
from superset.models.annotations import Annotation, AnnotationLayer
@@ -15,11 +16,25 @@ from .base import DeleteMixin, SupersetModelView
class AnnotationModelView(SupersetModelView, DeleteMixin): # noqa
datamodel = SQLAInterface(Annotation)
+
+ list_title = _('List Annotation')
+ show_title = _('Show Annotation')
+ add_title = _('Add Annotation')
+ edit_title = _('Edit Annotation')
+
list_columns = ['layer', 'short_descr', 'start_dttm', 'end_dttm']
edit_columns = [
'layer', 'short_descr', 'long_descr', 'start_dttm', 'end_dttm']
add_columns = edit_columns
+ label_columns = {
+ 'layer': _('Layer'),
+ 'short_descr': _('Short Descr'),
+ 'start_dttm': _('Start Dttm'),
+ 'end_dttm': _('End Dttm'),
+ 'long_descr': _('Long Descr'),
+ }
+
def pre_add(self, obj):
if not obj.layer:
raise Exception('Annotation layer is required.')
@@ -38,10 +53,21 @@ class AnnotationModelView(SupersetModelView, DeleteMixin): # noqa
class AnnotationLayerModelView(SupersetModelView, DeleteMixin):
datamodel = SQLAInterface(AnnotationLayer)
+
+ list_title = _('List Annotation Layer')
+ show_title = _('Show Annotation Layer')
+ add_title = _('Add Annotation Layer')
+ edit_title = _('Edit Annotation Layer')
+
list_columns = ['id', 'name']
edit_columns = ['name', 'descr']
add_columns = edit_columns
+ label_columns = {
+ 'name': _('Name'),
+ 'descr': _('Description'),
+ }
+
appbuilder.add_view(
AnnotationLayerModelView,
diff --git a/superset/views/core.py b/superset/views/core.py
index e6f29039e7..71f6ff1f21 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -240,6 +240,10 @@ class DatabaseView(SupersetModelView, DeleteMixin, YamlExportMixin): # noqa
'allow_run_sync': _('Allow Run Sync'),
'allow_run_async': _('Allow Run Async'),
'impersonate_user': _('Impersonate the logged on user'),
+ 'allow_csv_upload': _('Allow Csv Upload'),
+ 'modified': _('Modified'),
+ 'allow_multi_schema_metadata_fetch': _('Allow Multi Schema Metadata Fetch'),
+ 'backend': _('Backend'),
}
def pre_add(self, db):
@@ -624,6 +628,12 @@ appbuilder.add_view_no_menu(DashboardAddView)
class LogModelView(SupersetModelView):
datamodel = SQLAInterface(models.Log)
+
+ list_title = _('List Log')
+ show_title = _('Show Log')
+ add_title = _('Add Log')
+ edit_title = _('Edit Log')
+
list_columns = ('user', 'action', 'dttm')
edit_columns = ('user', 'action', 'dttm', 'json')
base_order = ('dttm', 'desc')
@@ -2725,6 +2735,12 @@ appbuilder.add_view_no_menu(Superset)
class CssTemplateModelView(SupersetModelView, DeleteMixin):
datamodel = SQLAInterface(models.CssTemplate)
+
+ list_title = _('List Css Template')
+ show_title = _('Show Css Template')
+ add_title = _('Add Css Template')
+ edit_title = _('Edit Css Template')
+
list_columns = ['template_name']
edit_columns = ['template_name', 'css']
add_columns = edit_columns