Skip to content

Commit

Permalink
[Discover] Fixing issue where i18n defaultMessage was a variable inst…
Browse files Browse the repository at this point in the history
…ead of a constant string
  • Loading branch information
davismcphee committed Jun 9, 2022
1 parent 637709d commit f816c4d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/plugins/discover/public/utils/get_field_type_name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export const KNOWN_FIELD_TYPES = {
VERSION: ES_FIELD_TYPES.VERSION,
};

export const UNKNOWN_FIELD_TYPE_MESSAGE = 'Unknown field';
export const UNKNOWN_FIELD_TYPE_MESSAGE = i18n.translate(
'discover.fieldNameIcons.unknownFieldAriaLabel',
{
defaultMessage: 'Unknown field',
}
);

export function getFieldTypeName(type?: string) {
switch (type) {
Expand Down Expand Up @@ -88,8 +93,6 @@ export function getFieldTypeName(type?: string) {
defaultMessage: 'Version field',
});
default:
return i18n.translate('discover.fieldNameIcons.unknownFieldAriaLabel', {
defaultMessage: UNKNOWN_FIELD_TYPE_MESSAGE,
});
return UNKNOWN_FIELD_TYPE_MESSAGE;
}
}

0 comments on commit f816c4d

Please sign in to comment.