Skip to content

Commit

Permalink
[8.11] [Lens] Fixes color mappings special tockens i18n (elastic#168152
Browse files Browse the repository at this point in the history
…) (elastic#168189)

# Backport

This will backport the following commits from `main` to `8.11`:
- [[Lens] Fixes color mappings special tockens i18n
(elastic#168152)](elastic#168152)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco
Vettorello","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-06T09:21:41Z","message":"[Lens]
Fixes color mappings special tockens i18n (elastic#168152)\n\n##
Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/168151\r\n\r\nTo test:\r\n-
create a cartesian charts with breakdowns that contains both
the\r\n`Other` group and an `(empty)` value\r\n- apply a manual color
mapping that use both these terms by select them\r\nfrom the combo-box,
not by typing them.\r\n- Then change the Kibana language to a different
one other than English\r\nand see if the color mapping applies
correctly.\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"c828ff49dbf7f4e8ef28adf832ab40bd495ea2db","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Team:Visualizations","release_note:skip","Feature:Lens","backport:prev-minor","v8.11.0","v8.12.0"],"number":168152,"url":"https://github.com/elastic/kibana/pull/168152","mergeCommit":{"message":"[Lens]
Fixes color mappings special tockens i18n (elastic#168152)\n\n##
Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/168151\r\n\r\nTo test:\r\n-
create a cartesian charts with breakdowns that contains both
the\r\n`Other` group and an `(empty)` value\r\n- apply a manual color
mapping that use both these terms by select them\r\nfrom the combo-box,
not by typing them.\r\n- Then change the Kibana language to a different
one other than English\r\nand see if the color mapping applies
correctly.\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"c828ff49dbf7f4e8ef28adf832ab40bd495ea2db"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/168152","number":168152,"mergeCommit":{"message":"[Lens]
Fixes color mappings special tockens i18n (elastic#168152)\n\n##
Summary\r\n\r\nfix
https://github.com/elastic/kibana/issues/168151\r\n\r\nTo test:\r\n-
create a cartesian charts with breakdowns that contains both
the\r\n`Other` group and an `(empty)` value\r\n- apply a manual color
mapping that use both these terms by select them\r\nfrom the combo-box,
not by typing them.\r\n- Then change the Kibana language to a different
one other than English\r\nand see if the color mapping applies
correctly.\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<[email protected]>","sha":"c828ff49dbf7f4e8ef28adf832ab40bd495ea2db"}}]}]
BACKPORT-->

Co-authored-by: Marco Vettorello <[email protected]>
  • Loading branch information
kibanamachine and markov00 authored Oct 6, 2023
1 parent bedd8fe commit 30eaf44
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { i18n } from '@kbn/i18n';
import { ColorMapping } from '../config';

export function ruleMatch(
Expand Down Expand Up @@ -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)',
}),
],
]);
2 changes: 2 additions & 0 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 {分}}毎",
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 {分钟}}",
Expand Down

0 comments on commit 30eaf44

Please sign in to comment.