Skip to content

Commit

Permalink
fix filter label translation
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM committed Nov 28, 2019
1 parent 71594a8 commit e0632f2
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ interface Props {

export const FilterLabel = memo<Props>(({ filter, valueLabel }) => {
const prefixText = filter.meta.negate
? ` ${i18n.translate('data.filter.filterBar.negatedFilterPrefix', {
? ` ${i18n.translate('xpack.siem.detectionEngine.createRule.filterLabel.negatedFilterPrefix', {
defaultMessage: 'NOT ',
})}`
: '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,69 +16,93 @@ export interface Operator {
}

export const isOperator = {
message: i18n.translate('data.filter.filterEditor.isOperatorOptionLabel', {
defaultMessage: 'is',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.isOperatorOptionLabel',
{
defaultMessage: 'is',
}
),
type: esFilters.FILTERS.PHRASE,
negate: false,
};

export const isNotOperator = {
message: i18n.translate('data.filter.filterEditor.isNotOperatorOptionLabel', {
defaultMessage: 'is not',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.isNotOperatorOptionLabel',
{
defaultMessage: 'is not',
}
),
type: esFilters.FILTERS.PHRASE,
negate: true,
};

export const isOneOfOperator = {
message: i18n.translate('data.filter.filterEditor.isOneOfOperatorOptionLabel', {
defaultMessage: 'is one of',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.isOneOfOperatorOptionLabel',
{
defaultMessage: 'is one of',
}
),
type: esFilters.FILTERS.PHRASES,
negate: false,
fieldTypes: ['string', 'number', 'date', 'ip', 'geo_point', 'geo_shape'],
};

export const isNotOneOfOperator = {
message: i18n.translate('data.filter.filterEditor.isNotOneOfOperatorOptionLabel', {
defaultMessage: 'is not one of',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.isNotOneOfOperatorOptionLabel',
{
defaultMessage: 'is not one of',
}
),
type: esFilters.FILTERS.PHRASES,
negate: true,
fieldTypes: ['string', 'number', 'date', 'ip', 'geo_point', 'geo_shape'],
};

export const isBetweenOperator = {
message: i18n.translate('data.filter.filterEditor.isBetweenOperatorOptionLabel', {
defaultMessage: 'is between',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.isBetweenOperatorOptionLabel',
{
defaultMessage: 'is between',
}
),
type: esFilters.FILTERS.RANGE,
negate: false,
fieldTypes: ['number', 'date', 'ip'],
};

export const isNotBetweenOperator = {
message: i18n.translate('data.filter.filterEditor.isNotBetweenOperatorOptionLabel', {
defaultMessage: 'is not between',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.isNotBetweenOperatorOptionLabel',
{
defaultMessage: 'is not between',
}
),
type: esFilters.FILTERS.RANGE,
negate: true,
fieldTypes: ['number', 'date', 'ip'],
};

export const existsOperator = {
message: i18n.translate('data.filter.filterEditor.existsOperatorOptionLabel', {
defaultMessage: 'exists',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.existsOperatorOptionLabel',
{
defaultMessage: 'exists',
}
),
type: esFilters.FILTERS.EXISTS,
negate: false,
};

export const doesNotExistOperator = {
message: i18n.translate('data.filter.filterEditor.doesNotExistOperatorOptionLabel', {
defaultMessage: 'does not exist',
}),
message: i18n.translate(
'xpack.siem.detectionEngine.createRule.filterLabel.doesNotExistOperatorOptionLabel',
{
defaultMessage: 'does not exist',
}
),
type: esFilters.FILTERS.EXISTS,
negate: true,
};
Expand Down

0 comments on commit e0632f2

Please sign in to comment.