From 30eaf446ebef986e3f88323e23edd38aeec23311 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 6 Oct 2023 06:38:09 -0400 Subject: [PATCH] [8.11] [Lens] Fixes color mappings special tockens i18n (#168152) (#168189) # Backport This will backport the following commits from `main` to `8.11`: - [[Lens] Fixes color mappings special tockens i18n (#168152)](https://github.com/elastic/kibana/pull/168152) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Marco Vettorello --- .../color_mapping/color/rule_matching.ts | 15 +++++++++++++-- .../plugins/translations/translations/fr-FR.json | 2 ++ .../plugins/translations/translations/ja-JP.json | 2 ++ .../plugins/translations/translations/zh-CN.json | 2 ++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts b/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts index 7557644154a52..0d844ca26e27e 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/color/rule_matching.ts @@ -6,6 +6,7 @@ * Side Public License, v 1. */ +import { i18n } from '@kbn/i18n'; import { ColorMapping } from '../config'; export function ruleMatch( @@ -41,6 +42,16 @@ export function rangeMatch(rule: ColorMapping.RuleRange, value: number) { // TODO: move in some data/table related package export const SPECIAL_TOKENS_STRING_CONVERTION = new Map([ - ['__other__', 'Other'], - ['', '(empty)'], + [ + '__other__', + i18n.translate('coloring.colorMapping.terms.otherBucketLabel', { + defaultMessage: 'Other', + }), + ], + [ + '', + i18n.translate('coloring.colorMapping.terms.emptyLabel', { + defaultMessage: '(empty)', + }), + ], ]); diff --git a/x-pack/plugins/translations/translations/fr-FR.json b/x-pack/plugins/translations/translations/fr-FR.json index ffab35e1bfcde..b25e843e3d090 100644 --- a/x-pack/plugins/translations/translations/fr-FR.json +++ b/x-pack/plugins/translations/translations/fr-FR.json @@ -229,6 +229,8 @@ "coloring.dynamicColoring.rangeType.label": "Type de valeur", "coloring.dynamicColoring.rangeType.number": "Numéro", "coloring.dynamicColoring.rangeType.percent": "Pourcent", + "coloring.colorMapping.terms.otherBucketLabel": "Autre", + "coloring.colorMapping.terms.emptyLabel": "(vide)", "console.helpPage.learnAboutConsoleAndQueryDslText": "En savoir plus sur {console} et {queryDsl}", "console.historyPage.itemOfRequestListAriaLabel": "Requête : {historyItem}", "console.settingsPage.refreshInterval.everyNMinutesTimeInterval": "Toutes les {value} {value, plural, one {minute} many {minutes} other {minutes}}", diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 0cb40f216f1ef..552b9d5254860 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -229,6 +229,8 @@ "coloring.dynamicColoring.rangeType.label": "値型", "coloring.dynamicColoring.rangeType.number": "数字", "coloring.dynamicColoring.rangeType.percent": "割合(%)", + "coloring.colorMapping.terms.otherBucketLabel":"その他", + "coloring.colorMapping.terms.emptyLabel": "(空)", "console.helpPage.learnAboutConsoleAndQueryDslText": "{console}と{queryDsl}についてさらに詳しく", "console.historyPage.itemOfRequestListAriaLabel": "リクエスト:{historyItem}", "console.settingsPage.refreshInterval.everyNMinutesTimeInterval": "{value}{value, plural, other {分}}毎", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 13e65b096ae59..9fb5b6633599f 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -229,6 +229,8 @@ "coloring.dynamicColoring.rangeType.label": "值类型", "coloring.dynamicColoring.rangeType.number": "数字", "coloring.dynamicColoring.rangeType.percent": "百分比", + "coloring.colorMapping.terms.otherBucketLabel":"其他", + "coloring.colorMapping.terms.emptyLabel": "(空)", "console.helpPage.learnAboutConsoleAndQueryDslText": "了解 {console} 和 {queryDsl}", "console.historyPage.itemOfRequestListAriaLabel": "请求:{historyItem}", "console.settingsPage.refreshInterval.everyNMinutesTimeInterval": "每 {value} {value, plural, other {分钟}}",