mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
chore: Localization of several charts and elements (#22150)
Co-authored-by: ashumeiko <ashumeiko@ashumeiko.com>
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
||||
ControlPanelConfig,
|
||||
D3_FORMAT_DOCS,
|
||||
D3_TIME_FORMAT_OPTIONS,
|
||||
formatSelectOptions,
|
||||
getStandardizedControls,
|
||||
sections,
|
||||
temporalColumnMixin,
|
||||
@@ -179,13 +178,13 @@ const config: ControlPanelConfig = {
|
||||
type: 'SelectControl',
|
||||
label: t('Rolling Function'),
|
||||
default: 'None',
|
||||
choices: formatSelectOptions([
|
||||
'None',
|
||||
'mean',
|
||||
'sum',
|
||||
'std',
|
||||
'cumsum',
|
||||
]),
|
||||
choices: [
|
||||
['None', t('None')],
|
||||
['mean', t('mean')],
|
||||
['sum', t('sum')],
|
||||
['std', t('std')],
|
||||
['cumsum', t('cumsum')],
|
||||
],
|
||||
description: t(
|
||||
'Defines a rolling window function to apply, works along ' +
|
||||
'with the [Periods] text box',
|
||||
@@ -234,14 +233,14 @@ const config: ControlPanelConfig = {
|
||||
label: t('Rule'),
|
||||
default: null,
|
||||
choices: [
|
||||
['1T', '1 minutely frequency'],
|
||||
['1H', '1 hourly frequency'],
|
||||
['1D', '1 calendar day frequency'],
|
||||
['7D', '7 calendar day frequency'],
|
||||
['1MS', '1 month start frequency'],
|
||||
['1M', '1 month end frequency'],
|
||||
['1AS', '1 year start frequency'],
|
||||
['1A', '1 year end frequency'],
|
||||
['1T', t('1 minutely frequency')],
|
||||
['1H', t('1 hourly frequency')],
|
||||
['1D', t('1 calendar day frequency')],
|
||||
['7D', t('7 calendar day frequency')],
|
||||
['1MS', t('1 month start frequency')],
|
||||
['1M', t('1 month end frequency')],
|
||||
['1AS', t('1 year start frequency')],
|
||||
['1A', t('1 year end frequency')],
|
||||
],
|
||||
description: t('Pandas resample rule'),
|
||||
},
|
||||
|
||||
@@ -27,7 +27,6 @@ import {
|
||||
D3_FORMAT_DOCS,
|
||||
D3_FORMAT_OPTIONS,
|
||||
D3_TIME_FORMAT_OPTIONS,
|
||||
formatSelectOptions,
|
||||
sections,
|
||||
emitFilterControl,
|
||||
ControlPanelConfig,
|
||||
@@ -93,12 +92,12 @@ const config: ControlPanelConfig = {
|
||||
description: t(
|
||||
'Determines how whiskers and outliers are calculated.',
|
||||
),
|
||||
choices: formatSelectOptions([
|
||||
'Tukey',
|
||||
'Min/max (no outliers)',
|
||||
'2/98 percentiles',
|
||||
'9/91 percentiles',
|
||||
]),
|
||||
choices: [
|
||||
['Tukey', t('Tukey')],
|
||||
['Min/max (no outliers)', t('Min/max (no outliers)')],
|
||||
['2/98 percentiles', t('2/98 percentiles')],
|
||||
['9/91 percentiles', t('9/91 percentiles')],
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -116,13 +115,13 @@ const config: ControlPanelConfig = {
|
||||
config: {
|
||||
type: 'SelectControl',
|
||||
label: t('X Tick Layout'),
|
||||
choices: formatSelectOptions([
|
||||
'auto',
|
||||
'flat',
|
||||
'45°',
|
||||
'90°',
|
||||
'staggered',
|
||||
]),
|
||||
choices: [
|
||||
['auto', t('auto')],
|
||||
['flat', t('flat')],
|
||||
['45°', '45°'],
|
||||
['90°', '90°'],
|
||||
['staggered', t('staggered')],
|
||||
],
|
||||
default: 'auto',
|
||||
clearable: false,
|
||||
renderTrigger: true,
|
||||
|
||||
@@ -87,17 +87,17 @@ const config: ControlPanelConfig = {
|
||||
default: labelType,
|
||||
renderTrigger: true,
|
||||
choices: [
|
||||
[EchartsFunnelLabelTypeType.Key, 'Category Name'],
|
||||
[EchartsFunnelLabelTypeType.Value, 'Value'],
|
||||
[EchartsFunnelLabelTypeType.Percent, 'Percentage'],
|
||||
[EchartsFunnelLabelTypeType.KeyValue, 'Category and Value'],
|
||||
[EchartsFunnelLabelTypeType.Key, t('Category Name')],
|
||||
[EchartsFunnelLabelTypeType.Value, t('Value')],
|
||||
[EchartsFunnelLabelTypeType.Percent, t('Percentage')],
|
||||
[EchartsFunnelLabelTypeType.KeyValue, t('Category and Value')],
|
||||
[
|
||||
EchartsFunnelLabelTypeType.KeyPercent,
|
||||
'Category and Percentage',
|
||||
t('Category and Percentage'),
|
||||
],
|
||||
[
|
||||
EchartsFunnelLabelTypeType.KeyValuePercent,
|
||||
'Category, Value and Percentage',
|
||||
t('Category, Value and Percentage'),
|
||||
],
|
||||
],
|
||||
description: t('What should be shown on the label?'),
|
||||
|
||||
@@ -147,13 +147,13 @@ function createCustomizeSection(
|
||||
renderTrigger: true,
|
||||
default: seriesType,
|
||||
choices: [
|
||||
[EchartsTimeseriesSeriesType.Line, 'Line'],
|
||||
[EchartsTimeseriesSeriesType.Scatter, 'Scatter'],
|
||||
[EchartsTimeseriesSeriesType.Smooth, 'Smooth Line'],
|
||||
[EchartsTimeseriesSeriesType.Bar, 'Bar'],
|
||||
[EchartsTimeseriesSeriesType.Start, 'Step - start'],
|
||||
[EchartsTimeseriesSeriesType.Middle, 'Step - middle'],
|
||||
[EchartsTimeseriesSeriesType.End, 'Step - end'],
|
||||
[EchartsTimeseriesSeriesType.Line, t('Line')],
|
||||
[EchartsTimeseriesSeriesType.Scatter, t('Scatter')],
|
||||
[EchartsTimeseriesSeriesType.Smooth, t('Smooth Line')],
|
||||
[EchartsTimeseriesSeriesType.Bar, t('Bar')],
|
||||
[EchartsTimeseriesSeriesType.Start, t('Step - start')],
|
||||
[EchartsTimeseriesSeriesType.Middle, t('Step - middle')],
|
||||
[EchartsTimeseriesSeriesType.End, t('Step - end')],
|
||||
],
|
||||
description: t('Series chart type (line, bar etc)'),
|
||||
},
|
||||
|
||||
@@ -101,12 +101,12 @@ const config: ControlPanelConfig = {
|
||||
default: labelType,
|
||||
renderTrigger: true,
|
||||
choices: [
|
||||
['key', 'Category Name'],
|
||||
['value', 'Value'],
|
||||
['percent', 'Percentage'],
|
||||
['key_value', 'Category and Value'],
|
||||
['key_percent', 'Category and Percentage'],
|
||||
['key_value_percent', 'Category, Value and Percentage'],
|
||||
['key', t('Category Name')],
|
||||
['value', t('Value')],
|
||||
['percent', t('Percentage')],
|
||||
['key_value', t('Category and Value')],
|
||||
['key_percent', t('Category and Percentage')],
|
||||
['key_value_percent', t('Category, Value and Percentage')],
|
||||
],
|
||||
description: t('What should be shown on the label?'),
|
||||
},
|
||||
|
||||
@@ -108,8 +108,8 @@ const config: ControlPanelConfig = {
|
||||
default: labelType,
|
||||
renderTrigger: true,
|
||||
choices: [
|
||||
['value', 'Value'],
|
||||
['key_value', 'Category and Value'],
|
||||
['value', t('Value')],
|
||||
['key_value', t('Category and Value')],
|
||||
],
|
||||
description: t('What should be shown on the label?'),
|
||||
},
|
||||
|
||||
@@ -72,11 +72,11 @@ const config: ControlPanelConfig = {
|
||||
renderTrigger: true,
|
||||
default: seriesType,
|
||||
choices: [
|
||||
[EchartsTimeseriesSeriesType.Line, 'Line'],
|
||||
[EchartsTimeseriesSeriesType.Smooth, 'Smooth Line'],
|
||||
[EchartsTimeseriesSeriesType.Start, 'Step - start'],
|
||||
[EchartsTimeseriesSeriesType.Middle, 'Step - middle'],
|
||||
[EchartsTimeseriesSeriesType.End, 'Step - end'],
|
||||
[EchartsTimeseriesSeriesType.Line, t('Line')],
|
||||
[EchartsTimeseriesSeriesType.Smooth, t('Smooth Line')],
|
||||
[EchartsTimeseriesSeriesType.Start, t('Step - start')],
|
||||
[EchartsTimeseriesSeriesType.Middle, t('Step - middle')],
|
||||
[EchartsTimeseriesSeriesType.End, t('Step - end')],
|
||||
],
|
||||
description: t('Series chart type (line, bar etc)'),
|
||||
},
|
||||
|
||||
@@ -126,8 +126,8 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
|
||||
clearable: false,
|
||||
label: t('AXIS TITLE POSITION'),
|
||||
renderTrigger: true,
|
||||
default: sections.TITLE_POSITION_OPTIONS[0],
|
||||
choices: formatSelectOptions(sections.TITLE_POSITION_OPTIONS),
|
||||
default: sections.TITLE_POSITION_OPTIONS[0][0],
|
||||
choices: sections.TITLE_POSITION_OPTIONS,
|
||||
description: t('Changing this control takes effect instantly'),
|
||||
visibility: ({ controls }: ControlPanelsContainerProps) =>
|
||||
isXAxis ? isHorizental(controls) : isVertical(controls),
|
||||
|
||||
@@ -71,13 +71,13 @@ const config: ControlPanelConfig = {
|
||||
renderTrigger: true,
|
||||
default: seriesType,
|
||||
choices: [
|
||||
[EchartsTimeseriesSeriesType.Line, 'Line'],
|
||||
[EchartsTimeseriesSeriesType.Scatter, 'Scatter'],
|
||||
[EchartsTimeseriesSeriesType.Smooth, 'Smooth Line'],
|
||||
[EchartsTimeseriesSeriesType.Bar, 'Bar'],
|
||||
[EchartsTimeseriesSeriesType.Start, 'Step - start'],
|
||||
[EchartsTimeseriesSeriesType.Middle, 'Step - middle'],
|
||||
[EchartsTimeseriesSeriesType.End, 'Step - end'],
|
||||
[EchartsTimeseriesSeriesType.Line, t('Line')],
|
||||
[EchartsTimeseriesSeriesType.Scatter, t('Scatter')],
|
||||
[EchartsTimeseriesSeriesType.Smooth, t('Smooth Line')],
|
||||
[EchartsTimeseriesSeriesType.Bar, t('Bar')],
|
||||
[EchartsTimeseriesSeriesType.Start, t('Step - start')],
|
||||
[EchartsTimeseriesSeriesType.Middle, t('Step - middle')],
|
||||
[EchartsTimeseriesSeriesType.End, t('Step - end')],
|
||||
],
|
||||
description: t('Series chart type (line, bar etc)'),
|
||||
},
|
||||
|
||||
@@ -70,9 +70,9 @@ const config: ControlPanelConfig = {
|
||||
renderTrigger: true,
|
||||
default: EchartsTimeseriesSeriesType.Start,
|
||||
choices: [
|
||||
[EchartsTimeseriesSeriesType.Start, 'Start'],
|
||||
[EchartsTimeseriesSeriesType.Middle, 'Middle'],
|
||||
[EchartsTimeseriesSeriesType.End, 'End'],
|
||||
[EchartsTimeseriesSeriesType.Start, t('Start')],
|
||||
[EchartsTimeseriesSeriesType.Middle, t('Middle')],
|
||||
[EchartsTimeseriesSeriesType.End, t('End')],
|
||||
],
|
||||
description: t(
|
||||
'Defines whether the step should appear at the beginning, middle or end between two data points',
|
||||
|
||||
@@ -97,9 +97,9 @@ const config: ControlPanelConfig = {
|
||||
default: labelType,
|
||||
renderTrigger: true,
|
||||
choices: [
|
||||
['Key', 'Key'],
|
||||
['value', 'Value'],
|
||||
['key_value', 'Category and Value'],
|
||||
['Key', t('Key')],
|
||||
['value', t('Value')],
|
||||
['key_value', t('Category and Value')],
|
||||
],
|
||||
description: t('What should be shown on the label?'),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user