Skip to content

Commit

Permalink
[Localization] postfix ids with .markdown (#104062)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
Bamieh and kibanamachine authored Jul 3, 2021
1 parent 0681120 commit 7395fee
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const counterRateOperation: OperationDefinition<
signature: i18n.translate('xpack.lens.indexPattern.counterRate.signature', {
defaultMessage: 'metric: number',
}),
description: i18n.translate('xpack.lens.indexPattern.counterRate.documentation', {
description: i18n.translate('xpack.lens.indexPattern.counterRate.documentation.markdown', {
defaultMessage: `
Calculates the rate of an ever increasing counter. This function will only yield helpful results on counter metric fields which contain a measurement of some kind monotonically growing over time.
If the value does get smaller, it will interpret this as a counter reset. To get most precise results, \`counter_rate\` should be calculated on the \`max\` of a field.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const cumulativeSumOperation: OperationDefinition<
signature: i18n.translate('xpack.lens.indexPattern.cumulative_sum.signature', {
defaultMessage: 'metric: number',
}),
description: i18n.translate('xpack.lens.indexPattern.cumulativeSum.documentation', {
description: i18n.translate('xpack.lens.indexPattern.cumulativeSum.documentation.markdown', {
defaultMessage: `
Calculates the cumulative sum of a metric over time, adding all previous values of a series to each value. To use this function, you need to configure a date histogram dimension as well.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const derivativeOperation: OperationDefinition<
signature: i18n.translate('xpack.lens.indexPattern.differences.signature', {
defaultMessage: 'metric: number',
}),
description: i18n.translate('xpack.lens.indexPattern.differences.documentation', {
description: i18n.translate('xpack.lens.indexPattern.differences.documentation.markdown', {
defaultMessage: `
Calculates the difference to the last value of a metric over time. To use this function, you need to configure a date histogram dimension as well.
Differences requires the data to be sequential. If your data is empty when using differences, try increasing the date histogram interval.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const movingAverageOperation: OperationDefinition<
signature: i18n.translate('xpack.lens.indexPattern.moving_average.signature', {
defaultMessage: 'metric: number, [window]: number',
}),
description: i18n.translate('xpack.lens.indexPattern.movingAverage.documentation', {
description: i18n.translate('xpack.lens.indexPattern.movingAverage.documentation.markdown', {
defaultMessage: `
Calculates the moving average of a metric over time, averaging the last n-th values to calculate the current value. To use this function, you need to configure a date histogram dimension as well.
The default window value is {defaultValue}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const overallSumOperation = buildOverallMetricOperation<OverallSumIndexPa
});
},
metric: 'sum',
description: i18n.translate('xpack.lens.indexPattern.overall_sum.documentation', {
description: i18n.translate('xpack.lens.indexPattern.overall_sum.documentation.markdown', {
defaultMessage: `
Calculates the sum of a metric of all data points of a series in the current chart. A series is defined by a dimension using a date histogram or interval function.
Other dimensions breaking down the data like top values or filter are treated as separate series.
Expand Down Expand Up @@ -146,7 +146,7 @@ export const overallMinOperation = buildOverallMetricOperation<OverallMinIndexPa
});
},
metric: 'min',
description: i18n.translate('xpack.lens.indexPattern.overall_min.documentation', {
description: i18n.translate('xpack.lens.indexPattern.overall_min.documentation.markdown', {
defaultMessage: `
Calculates the minimum of a metric for all data points of a series in the current chart. A series is defined by a dimension using a date histogram or interval function.
Other dimensions breaking down the data like top values or filter are treated as separate series.
Expand Down Expand Up @@ -177,7 +177,7 @@ export const overallMaxOperation = buildOverallMetricOperation<OverallMaxIndexPa
});
},
metric: 'max',
description: i18n.translate('xpack.lens.indexPattern.overall_max.documentation', {
description: i18n.translate('xpack.lens.indexPattern.overall_max.documentation.markdown', {
defaultMessage: `
Calculates the maximum of a metric for all data points of a series in the current chart. A series is defined by a dimension using a date histogram or interval function.
Other dimensions breaking down the data like top values or filter are treated as separate series.
Expand Down Expand Up @@ -209,7 +209,7 @@ export const overallAverageOperation = buildOverallMetricOperation<OverallAverag
});
},
metric: 'average',
description: i18n.translate('xpack.lens.indexPattern.overall_average.documentation', {
description: i18n.translate('xpack.lens.indexPattern.overall_average.documentation.markdown', {
defaultMessage: `
Calculates the average of a metric for all data points of a series in the current chart. A series is defined by a dimension using a date histogram or interval function.
Other dimensions breaking down the data like top values or filter are treated as separate series.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const cardinalityOperation: OperationDefinition<CardinalityIndexPatternCo
signature: i18n.translate('xpack.lens.indexPattern.cardinality.signature', {
defaultMessage: 'field: string',
}),
description: i18n.translate('xpack.lens.indexPattern.cardinality.documentation', {
description: i18n.translate('xpack.lens.indexPattern.cardinality.documentation.markdown', {
defaultMessage: `
Calculates the number of unique values of a specified field. Works for number, string, date and boolean values.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export const countOperation: OperationDefinition<CountIndexPatternColumn, 'field
documentation: {
section: 'elasticsearch',
signature: '',
description: i18n.translate('xpack.lens.indexPattern.count.documentation', {
description: i18n.translate('xpack.lens.indexPattern.count.documentation.markdown', {
defaultMessage: `
Calculates the number of documents.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ function FormulaHelp({
}),
description: (
<Markdown
markdown={i18n.translate('xpack.lens.formulaDocumentation.filterRatioDescription', {
defaultMessage: `### Filter ratio:
markdown={i18n.translate(
'xpack.lens.formulaDocumentation.filterRatioDescription.markdown',
{
defaultMessage: `### Filter ratio:
Use \`kql=''\` to filter one set of documents and compare it to other documents within the same grouping.
For example, to see how the error rate changes over time:
Expand All @@ -90,9 +92,10 @@ count(kql='response.status_code > 400') / count()
\`\`\`
`,

description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
})}
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
}
)}
/>
),
},
Expand All @@ -102,8 +105,10 @@ count(kql='response.status_code > 400') / count()
}),
description: (
<Markdown
markdown={i18n.translate('xpack.lens.formulaDocumentation.weekOverWeekDescription', {
defaultMessage: `### Week over week:
markdown={i18n.translate(
'xpack.lens.formulaDocumentation.weekOverWeekDescription.markdown',
{
defaultMessage: `### Week over week:
Use \`shift='1w'\` to get the value of each grouping from
the previous week. Time shift should not be used with the *Top values* function.
Expand All @@ -114,9 +119,10 @@ percentile(system.network.in.bytes, percentile=99, shift='1w')
\`\`\`
`,

description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
})}
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
}
)}
/>
),
},
Expand All @@ -126,8 +132,10 @@ percentile(system.network.in.bytes, percentile=99, shift='1w')
}),
description: (
<Markdown
markdown={i18n.translate('xpack.lens.formulaDocumentation.percentOfTotalDescription', {
defaultMessage: `### Percent of total
markdown={i18n.translate(
'xpack.lens.formulaDocumentation.percentOfTotalDescription.markdown',
{
defaultMessage: `### Percent of total
Formulas can calculate \`overall_sum\` for all the groupings,
which lets you convert each grouping into a percent of total:
Expand All @@ -137,9 +145,10 @@ sum(products.base_price) / overall_sum(sum(products.base_price))
\`\`\`
`,

description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
})}
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
}
)}
/>
),
},
Expand Down Expand Up @@ -372,9 +381,8 @@ sum(products.base_price) / overall_sum(sum(products.base_price))
}}
>
<Markdown
markdown={i18n.translate('xpack.lens.formulaDocumentation', {
defaultMessage: `
## How it works
markdown={i18n.translate('xpack.lens.formulaDocumentation.markdown', {
defaultMessage: `## How it works
Lens formulas let you do math using a combination of Elasticsearch aggregations and
math functions. There are three main types of functions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const lastValueOperation: OperationDefinition<LastValueIndexPatternColumn
signature: i18n.translate('xpack.lens.indexPattern.lastValue.signature', {
defaultMessage: 'field: string',
}),
description: i18n.translate('xpack.lens.indexPattern.lastValue.documentation', {
description: i18n.translate('xpack.lens.indexPattern.lastValue.documentation.markdown', {
defaultMessage: `
Returns the value of a field from the last document, ordered by the default time field of the index pattern.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function buildMetricOperation<T extends MetricColumn<string>>({
signature: i18n.translate('xpack.lens.indexPattern.metric.signature', {
defaultMessage: 'field: string',
}),
description: i18n.translate('xpack.lens.indexPattern.metric.documentation', {
description: i18n.translate('xpack.lens.indexPattern.metric.documentation.markdown', {
defaultMessage: `
Returns the {metric} of a field. This function only works for number fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const percentileOperation: OperationDefinition<PercentileIndexPatternColu
signature: i18n.translate('xpack.lens.indexPattern.percentile.signature', {
defaultMessage: 'field: string, [percentile]: number',
}),
description: i18n.translate('xpack.lens.indexPattern.percentile.documentation', {
description: i18n.translate('xpack.lens.indexPattern.percentile.documentation.markdown', {
defaultMessage: `
Returns the specified percentile of the values of a field. This is the value n percent of the values occuring in documents are smaller.
Expand Down

0 comments on commit 7395fee

Please sign in to comment.