Skip to content

Commit

Permalink
R Austin review: spelling / i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Kimmel committed Jun 18, 2020
1 parent ed73b46 commit 14db86c
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export const PanelContentError = memo(function ({
const crumbs = useMemo(() => {
return [
{
text: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.error.events', {
text: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.error.events', {
defaultMessage: 'Events',
}),
onClick: () => {
pushToQueryParams({ crumbId: '', crumbEvent: '' });
},
},
{
text: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.error.error', {
text: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.error.error', {
defaultMessage: 'Error',
}),
onClick: () => {},
Expand All @@ -51,7 +51,7 @@ export const PanelContentError = memo(function ({
pushToQueryParams({ crumbId: '', crumbEvent: '' });
}}
>
{i18n.translate('xpack.securitySolution.enpoint.resolver.panel.error.goBack', {
{i18n.translate('xpack.securitySolution.endpoint.resolver.panel.error.goBack', {
defaultMessage: 'Click this link to return to the list of all processes.',
})}
</EuiButtonEmpty>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ProcessDetails = memo(function ProcessDetails({

const createdEntry = {
title: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processDescList.created',
'xpack.securitySolution.endpoint.resolver.panel.processDescList.created',
{
defaultMessage: 'Created',
}
Expand All @@ -62,29 +62,29 @@ export const ProcessDetails = memo(function ProcessDetails({
};

const pathEntry = {
title: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.processDescList.path', {
title: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.processDescList.path', {
defaultMessage: 'Path',
}),
description: processPath(processEvent),
};

const pidEntry = {
title: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.processDescList.pid', {
title: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.processDescList.pid', {
defaultMessage: 'PID',
}),
description: processPid(processEvent),
};

const userEntry = {
title: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.processDescList.user', {
title: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.processDescList.user', {
defaultMessage: 'User',
}),
description: (userInfoForProcess(processEvent) as { name: string }).name,
};

const domainEntry = {
title: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processDescList.domain',
'xpack.securitySolution.endpoint.resolver.panel.processDescList.domain',
{
defaultMessage: 'Domain',
}
Expand All @@ -94,7 +94,7 @@ export const ProcessDetails = memo(function ProcessDetails({

const parentPidEntry = {
title: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processDescList.parentPid',
'xpack.securitySolution.endpoint.resolver.panel.processDescList.parentPid',
{
defaultMessage: 'Parent PID',
}
Expand All @@ -104,7 +104,7 @@ export const ProcessDetails = memo(function ProcessDetails({

const md5Entry = {
title: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processDescList.md5hash',
'xpack.securitySolution.endpoint.resolver.panel.processDescList.md5hash',
{
defaultMessage: 'MD5',
}
Expand All @@ -114,7 +114,7 @@ export const ProcessDetails = memo(function ProcessDetails({

const commandLineEntry = {
title: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processDescList.commandLine',
'xpack.securitySolution.endpoint.resolver.panel.processDescList.commandLine',
{
defaultMessage: 'Command Line',
}
Expand Down Expand Up @@ -150,7 +150,7 @@ export const ProcessDetails = memo(function ProcessDetails({
return [
{
text: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processDescList.events',
'xpack.securitySolution.endpoint.resolver.panel.processDescList.events',
{
defaultMessage: 'Events',
}
Expand All @@ -163,7 +163,7 @@ export const ProcessDetails = memo(function ProcessDetails({
text: (
<>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.numberOfEvents"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.numberOfEvents"
values={{ processName }}
defaultMessage="Details for: {processName}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const ProcessListWithCounts = memo(function ProcessListWithCounts({
{
field: 'name',
name: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.table.row.processNameTitle',
'xpack.securitySolution.endpoint.resolver.panel.table.row.processNameTitle',
{
defaultMessage: 'Process Name',
}
Expand All @@ -69,7 +69,7 @@ export const ProcessListWithCounts = memo(function ProcessListWithCounts({
return name === '' ? (
<EuiBadge color="warning">
{i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.table.row.valueMissingDescription',
'xpack.securitySolution.endpoint.resolver.panel.table.row.valueMissingDescription',
{
defaultMessage: 'Value is missing',
}
Expand All @@ -91,7 +91,7 @@ export const ProcessListWithCounts = memo(function ProcessListWithCounts({
{
field: 'timestamp',
name: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.table.row.timestampTitle',
'xpack.securitySolution.endpoint.resolver.panel.table.row.timestampTitle',
{
defaultMessage: 'Timestamp',
}
Expand All @@ -104,7 +104,7 @@ export const ProcessListWithCounts = memo(function ProcessListWithCounts({
) : (
<EuiBadge color="warning">
{i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.table.row.timestampInvalidLabel',
'xpack.securitySolution.endpoint.resolver.panel.table.row.timestampInvalidLabel',
{
defaultMessage: 'invalid',
}
Expand Down Expand Up @@ -143,7 +143,7 @@ export const ProcessListWithCounts = memo(function ProcessListWithCounts({
return [
{
text: i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processListWithCounts.events',
'xpack.securitySolution.endpoint.resolver.panel.processListWithCounts.events',
{
defaultMessage: 'All Process Events',
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const EventCountsForProcess = memo(function EventCountsForProcess({
0
);
const eventsString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processEventCounts.events',
'xpack.securitySolution.endpoint.resolver.panel.processEventCounts.events',
{
defaultMessage: 'Events',
}
Expand All @@ -79,7 +79,7 @@ export const EventCountsForProcess = memo(function EventCountsForProcess({
text: (
<>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.numberOfEvents"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.numberOfEvents"
values={{ totalCount }}
defaultMessage="{totalCount} Events"
/>
Expand All @@ -105,15 +105,15 @@ export const EventCountsForProcess = memo(function EventCountsForProcess({
() => [
{
field: 'count',
name: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.table.row.count', {
name: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.table.row.count', {
defaultMessage: 'Count',
}),
width: '20%',
sortable: true,
},
{
field: 'name',
name: i18n.translate('xpack.securitySolution.enpoint.resolver.panel.table.row.eventType', {
name: i18n.translate('xpack.securitySolution.endpoint.resolver.panel.table.row.eventType', {
defaultMessage: 'Event Type',
}),
width: '80%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
const processEntityId = parentEvent && event.entityId(parentEvent);
const totalCount = countForParent || 0;
const eventsString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.events',
'xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.events',
{
defaultMessage: 'Events',
}
);
const naString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.NA',
'xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.NA',
{
defaultMessage: 'N/A',
}
Expand Down Expand Up @@ -216,7 +216,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
text: (
<>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.numberOfEvents"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.numberOfEvents"
values={{ totalCount }}
defaultMessage="{totalCount} Events"
/>
Expand All @@ -230,7 +230,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
text: (
<>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.countByCategory"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.countByCategory"
values={{ count: countBySameCategory, category: relatedEventCategory }}
defaultMessage="{count} {category}"
/>
Expand All @@ -246,7 +246,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
{
text: relatedEventToShowDetailsFor ? (
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.eventDescriptiveName"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.eventDescriptiveName"
values={{ subject, descriptor }}
defaultMessage="{descriptor} {subject}"
/>
Expand Down Expand Up @@ -275,7 +275,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
*/
if (!relatedsReady) {
const waitingString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.relatedDetail.wait',
'xpack.securitySolution.endpoint.resolver.panel.relatedDetail.wait',
{
defaultMessage: 'Waiting For Events...',
}
Expand All @@ -296,7 +296,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
*/
if (!relatedEventToShowDetailsFor) {
const errString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.relatedDetail.missing',
'xpack.securitySolution.endpoint.resolver.panel.relatedDetail.missing',
{
defaultMessage: 'Related event not found.',
}
Expand All @@ -313,7 +313,7 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
<EuiText size="s">
<BoldCode>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.categoryAndType"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.categoryAndType"
values={{
category: relatedEventCategory,
eventType: String(event.ecsEventType(relatedEventToShowDetailsFor)),
Expand All @@ -322,15 +322,15 @@ export const RelatedEventDetail = memo(function RelatedEventDetail({
/>
</BoldCode>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.atTime"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.atTime"
values={{ date: formattedDate }}
defaultMessage="@ {date}"
/>
</EuiText>
<EuiSpacer size="m" />
<EuiText>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.eventDescriptiveNameInTitle"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.eventDescriptiveNameInTitle"
values={{ subject, descriptor }}
defaultMessage="{descriptor} {subject}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DisplayList = memo(function DisplayList({
<EuiText>
<BoldCode>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.categoryAndType"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.categoryAndType"
values={{
category: eventView.eventCategory,
eventType: eventView.eventType,
Expand All @@ -62,15 +62,15 @@ const DisplayList = memo(function DisplayList({
/>
</BoldCode>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventDetail.atTime"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventDetail.atTime"
values={{ date: eventView.formattedDate }}
defaultMessage="@ {date}"
/>
</EuiText>
<EuiSpacer size="xs" />
<EuiButtonEmpty onClick={eventView.setQueryParams}>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.processEventListByType.eventDescriptiveName"
id="xpack.securitySolution.endpoint.resolver.panel.processEventListByType.eventDescriptiveName"
values={{ subject, descriptor }}
defaultMessage="{descriptor} {subject}"
/>
Expand Down Expand Up @@ -102,13 +102,13 @@ export const ProcessEventListNarrowedByType = memo(function ProcessEventListNarr
0
);
const eventsString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processEventListByType.events',
'xpack.securitySolution.endpoint.resolver.panel.processEventListByType.events',
{
defaultMessage: 'Events',
}
);
const waitingString = i18n.translate(
'xpack.securitySolution.enpoint.resolver.panel.processEventListByType.wait',
'xpack.securitySolution.endpoint.resolver.panel.processEventListByType.wait',
{
defaultMessage: 'Waiting For Events...',
}
Expand Down Expand Up @@ -194,7 +194,7 @@ export const ProcessEventListNarrowedByType = memo(function ProcessEventListNarr
text: (
<>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventList.numberOfEvents"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventList.numberOfEvents"
values={{ totalCount }}
defaultMessage="{totalCount} Events"
/>
Expand All @@ -208,7 +208,7 @@ export const ProcessEventListNarrowedByType = memo(function ProcessEventListNarr
text: (
<>
<FormattedMessage
id="xpack.securitySolution.enpoint.resolver.panel.relatedEventList.countByCategory"
id="xpack.securitySolution.endpoint.resolver.panel.relatedEventList.countByCategory"
values={{ count: matchingEventEntries.length, category: eventType }}
defaultMessage="{count} {category}"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ export const formatter = new Intl.DateTimeFormat(i18n.getLocale(), {
second: '2-digit',
});

const invalidDateText = i18n.translate(
'xpack.securitySolution.enpdoint.resolver.panelutils.invaliddate',
{
defaultMessage: 'Invalid Date',
}
);
/**
* @param {ConstructorParameters<typeof Date>[0]} timestamp To be passed through Date->Intl.DateTimeFormat
* @returns {string} A nicely formatted string for a date
Expand All @@ -79,6 +85,6 @@ export function formatDate(timestamp: ConstructorParameters<typeof Date>[0]) {
if (isFinite(date.getTime())) {
return formatter.format(date);
} else {
return 'Invalid Date';
return invalidDateText;
}
}

0 comments on commit 14db86c

Please sign in to comment.