From 02b4e6b3591aa386462297007257f85eb5b62eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Wed, 6 Mar 2019 15:59:30 +0000 Subject: [PATCH] [CCR] Fix form bug + add missing i18n (#32544) (#32557) * [Rollup] Fix month value in form select * [Rollup] Add missing i18n for field types --- .../crud_app/sections/job_create/job_create.js | 15 ++++++++++++--- .../public/crud_app/services/humanized_numbers.js | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js index 3e40b4c61f5c7..48876c24418ba 100644 --- a/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js +++ b/x-pack/plugins/rollup/public/crud_app/sections/job_create/job_create.js @@ -186,9 +186,18 @@ export class JobCreateUi extends Component { )]; } - const formattedNumericFields = formatFields(numericFields, 'numeric'); - const formattedKeywordFields = formatFields(keywordFields, 'keyword'); - const formattedDateFields = formatFields(indexPatternDateFields, 'date'); + const formattedNumericFields = formatFields( + numericFields, + i18n.translate('xpack.rollupJobs.create.numericTypeField', { defaultMessage: 'numeric' }) + ); + const formattedKeywordFields = formatFields( + keywordFields, + i18n.translate('xpack.rollupJobs.create.keywordTypeField', { defaultMessage: 'keyword' }) + ); + const formattedDateFields = formatFields( + indexPatternDateFields, + i18n.translate('xpack.rollupJobs.create.dateTypeField', { defaultMessage: 'date' }) + ); function sortFields(a, b) { const nameA = a.name.toUpperCase(); diff --git a/x-pack/plugins/rollup/public/crud_app/services/humanized_numbers.js b/x-pack/plugins/rollup/public/crud_app/services/humanized_numbers.js index 88e97034db70e..6ec71f75be1de 100644 --- a/x-pack/plugins/rollup/public/crud_app/services/humanized_numbers.js +++ b/x-pack/plugins/rollup/public/crud_app/services/humanized_numbers.js @@ -21,8 +21,8 @@ const dayOrdinalToDayNameMap = { const monthOrdinalToMonthNameMap = { 0: i18n.translate('xpack.rollupJobs.util.month.january', { defaultMessage: 'January' }), 1: i18n.translate('xpack.rollupJobs.util.month.february', { defaultMessage: 'February' }), - 2: i18n.translate('xpack.rollupJobs.util.month.march', { defaultMessage: 'April' }), - 3: i18n.translate('xpack.rollupJobs.util.month.april', { defaultMessage: 'March' }), + 2: i18n.translate('xpack.rollupJobs.util.month.march', { defaultMessage: 'March' }), + 3: i18n.translate('xpack.rollupJobs.util.month.april', { defaultMessage: 'April' }), 4: i18n.translate('xpack.rollupJobs.util.month.may', { defaultMessage: 'May' }), 5: i18n.translate('xpack.rollupJobs.util.month.june', { defaultMessage: 'June' }), 6: i18n.translate('xpack.rollupJobs.util.month.july', { defaultMessage: 'July' }),