Skip to content

Commit

Permalink
Localize strings in Rollup and ILM apps. (elastic#29034)
Browse files Browse the repository at this point in the history
* Add ILM to i18nrc.json. Fix validation errors.
* Localize CCR and Rollups checkLicense errors.
* Fix bug in Remote Clusters checkLicense error.
* Use rollupJobs namespace in checkLicense.
  • Loading branch information
cjcenizal committed Jan 24, 2019
1 parent 80dfdf7 commit 1759396
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 72 deletions.
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"xpack.graph": "x-pack/plugins/graph",
"xpack.grokDebugger": "x-pack/plugins/grokdebugger",
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.indexLifecycleMgmt": "x-pack/plugins/index_lifecycle_management",
"xpack.infra": "x-pack/plugins/infra",
"xpack.licenseMgmt": "x-pack/plugins/license_management",
"xpack.ml": "x-pack/plugins/ml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { i18n } from '@kbn/i18n';

export function checkLicense(xpackLicenseInfo) {
const pluginName = 'Cross Cluster Replication';

Expand All @@ -14,7 +16,13 @@ export function checkLicense(xpackLicenseInfo) {
isAvailable: false,
showLinks: true,
enableLinks: false,
message: `You cannot use ${pluginName} because license information is not available at this time.`,
message: i18n.translate(
'xpack.crossClusterReplication.checkLicense.errorUnavailableMessage',
{
defaultMessage: 'You cannot use {pluginName} because license information is not available at this time.',
values: { pluginName },
},
),
};
}

Expand All @@ -29,7 +37,13 @@ export function checkLicense(xpackLicenseInfo) {
return {
isAvailable: false,
showLinks: false,
message: `Your ${licenseType} license does not support ${pluginName}. Please upgrade your license.`,
message: i18n.translate(
'xpack.crossClusterReplication.checkLicense.errorUnsupportedMessage',
{
defaultMessage: 'Your {licenseType} license does not support {pluginName}. Please upgrade your license.',
values: { licenseType, pluginName },
},
),
};
}

Expand All @@ -39,7 +53,13 @@ export function checkLicense(xpackLicenseInfo) {
isAvailable: false,
showLinks: true,
enableLinks: false,
message: `You cannot use ${pluginName} because your ${licenseType} license has expired.`,
message: i18n.translate(
'xpack.crossClusterReplication.checkLicense.errorExpiredMessage',
{
defaultMessage: 'You cannot use {pluginName} because your {licenseType} license has expired',
values: { licenseType, pluginName },
},
),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ exports[`ilm summary extension should return extension when index has lifecycle
>
<FormattedMessage
defaultMessage="Index lifecycle management"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.summaryTitle"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryTitle"
values={Object {}}
>
Index lifecycle management
Expand All @@ -269,7 +269,7 @@ exports[`ilm summary extension should return extension when index has lifecycle
title={
<FormattedMessage
defaultMessage="Index lifecycle error"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"
values={Object {}}
/>
}
Expand Down Expand Up @@ -317,7 +317,7 @@ exports[`ilm summary extension should return extension when index has lifecycle
>
<FormattedMessage
defaultMessage="Index lifecycle error"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"
values={Object {}}
>
Index lifecycle error
Expand Down Expand Up @@ -521,7 +521,7 @@ exports[`ilm summary extension should return extension when index has lifecycle
>
<FormattedMessage
defaultMessage="Show phase definition"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"
values={Object {}}
/>
</EuiLink>
Expand Down Expand Up @@ -559,7 +559,7 @@ exports[`ilm summary extension should return extension when index has lifecycle
>
<FormattedMessage
defaultMessage="Show phase definition"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"
values={Object {}}
>
Show phase definition
Expand Down Expand Up @@ -720,7 +720,7 @@ exports[`ilm summary extension should return extension when index has lifecycle
>
<FormattedMessage
defaultMessage="Index lifecycle management"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.summaryTitle"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryTitle"
values={Object {}}
>
Index lifecycle management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class AddLifecyclePolicyConfirmModal extends Component {
const title = (
<FormattedMessage
id="xpack.indexLifecycleMgmt.indexManagementTable.addLifecyclePolicyConfirmModal.modalTitle"
defaultMessage={`Add lifecycle policy to "{indexName}"`}
defaultMessage="Add lifecycle policy to &quot;{indexName}&quot;"
values={{
indexName,
}}
Expand All @@ -224,11 +224,11 @@ export class AddLifecyclePolicyConfirmModal extends Component {
onClose={closeModal}
>
<EuiModalHeader>
<EuiModalHeaderTitle >
<EuiModalHeaderTitle>
{title}
</EuiModalHeaderTitle >

</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
<EuiCallOut
style={{ maxWidth: 400 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { getPolicyPath } from '../../services/navigation';
const getHeaders = () => {
return {
policy: i18n.translate('xpack.idxMgmt.indexLifecycleMgmtSummary.headers.lifecyclePolicyHeader', {
policy: i18n.translate('xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.lifecyclePolicyHeader', {
defaultMessage: 'Lifecycle policy',
}),
phase: i18n.translate('xpack.idxMgmt.indexLifecycleMgmtSummary.headers.currentPhaseHeader', {
phase: i18n.translate('xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentPhaseHeader', {
defaultMessage: 'Current phase',
}),
action: i18n.translate('xpack.idxMgmt.indexLifecycleMgmtSummary.headers.currentActionHeader', {
action: i18n.translate('xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionHeader', {
defaultMessage: 'Current action',
}),
action_time_millis: i18n.translate('xpack.idxMgmt.indexLifecycleMgmtSummary.headers.currentActionTimeHeader', {
action_time_millis: i18n.translate('xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.currentActionTimeHeader', {
defaultMessage: 'Current action time',
}),
failed_step: i18n.translate('xpack.idxMgmt.indexLifecycleMgmtSummary.headers.failedStepHeader', {
failed_step: i18n.translate('xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.headers.failedStepHeader', {
defaultMessage: 'Failed step',
}),
};
Expand Down Expand Up @@ -70,7 +70,7 @@ export class IndexLifecycleSummary extends Component {
<EuiButtonEmpty onClick={this.toggleStackPopover}>
<FormattedMessage
defaultMessage="Stack trace"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.stackTraceButton"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.stackTraceButton"
/>
</EuiButtonEmpty>
);
Expand All @@ -95,7 +95,7 @@ export class IndexLifecycleSummary extends Component {
<EuiLink onClick={this.togglePhaseExecutionPopover}>
<FormattedMessage
defaultMessage="Show phase definition"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.showPhaseDefinitionButton"
/>
</EuiLink>
);
Expand All @@ -111,7 +111,7 @@ export class IndexLifecycleSummary extends Component {
<EuiPopoverTitle>
<FormattedMessage
defaultMessage="Phase definition"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.phaseDefinitionTitle"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.phaseDefinitionTitle"
/>
</EuiPopoverTitle>
<div style={{ maxHeight: '400px', width: '400px', overflowY: 'scroll' }}>
Expand Down Expand Up @@ -168,7 +168,7 @@ export class IndexLifecycleSummary extends Component {
<h3>
<FormattedMessage
defaultMessage="Index lifecycle management"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.summaryTitle"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryTitle"
/>
</h3>
</EuiTitle>
Expand All @@ -180,7 +180,7 @@ export class IndexLifecycleSummary extends Component {
title={
<FormattedMessage
defaultMessage="Index lifecycle error"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.summaryErrorMessage"
/>
}
iconType="cross"
Expand All @@ -199,7 +199,7 @@ export class IndexLifecycleSummary extends Component {
title={
<FormattedMessage
defaultMessage="Action status"
id="xpack.idxMgmt.indexLifecycleMgmtSummary.actionStatusTitle"
id="xpack.indexLifecycleMgmt.indexLifecycleMgmtSummary.actionStatusTitle"
/>
}
>
Expand All @@ -223,4 +223,4 @@ export class IndexLifecycleSummary extends Component {
</Fragment>
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class RemoveLifecyclePolicyConfirmModal extends Component {
title={
<FormattedMessage
id="xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.modalTitle"
defaultMessage={`Remove lifecycle policy from "{target}"`}
defaultMessage="Remove lifecycle policy from &quot;{target}&quot;"
values={{
target
}}
Expand All @@ -108,8 +108,8 @@ export class RemoveLifecyclePolicyConfirmModal extends Component {
>
<FormattedMessage
id="xpack.indexLifecycleMgmt.indexManagementTable.removeLifecyclePolicyConfirmModal.removeMessage"
defaultMessage={`You are about to remove the index lifecycle policy from "{target}".
This operation cannot be undone.`}
defaultMessage="You are about to remove the index lifecycle policy from &quot;{target}&quot;.
This operation cannot be undone."
values={{
target
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export const retryLifecycleActionExtension = indices => {
requestMethod: retryLifecycleForIndex,
icon: 'play',
indexNames: [indexNames],
buttonLabel: i18n.translate('xpack.idxMgmt.retryIndexLifecycleActionButtonLabel', {
buttonLabel: i18n.translate('xpack.indexLifecycleMgmt.retryIndexLifecycleActionButtonLabel', {
defaultMessage: 'Retry lifecycle step',
}),
successMessage: i18n.translate(
'xpack.idxMgmt.retryIndexLifecycleAction.retriedLifecycleMessage',
'xpack.indexLifecycleMgmt.retryIndexLifecycleAction.retriedLifecycleMessage',
{
defaultMessage: 'Called retry lifecycle step for: {indexNames}',
values: { indexNames: indexNames.map(indexName => `"${indexName}"`).join(', ') },
Expand Down Expand Up @@ -65,7 +65,7 @@ export const removeLifecyclePolicyActionExtension = (indices, reloadIndices) =>
},
icon: 'stopFilled',
indexNames: [indexNames],
buttonLabel: i18n.translate('xpack.idxMgmt.removeIndexLifecycleActionButtonLabel', {
buttonLabel: i18n.translate('xpack.indexLifecycleMgmt.removeIndexLifecycleActionButtonLabel', {
defaultMessage: 'Remove lifecycle policy',
}),
};
Expand Down Expand Up @@ -95,7 +95,7 @@ export const addLifecyclePolicyActionExtension = (indices, reloadIndices) => {
);
},
icon: 'plusInCircle',
buttonLabel: i18n.translate('xpack.idxMgmt.addLifecyclePolicyActionButtonLabel', {
buttonLabel: i18n.translate('xpack.indexLifecycleMgmt.addLifecyclePolicyActionButtonLabel', {
defaultMessage: 'Add lifecycle policy',
}),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class HotPhaseUi extends PureComponent {
<p>
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.hotPhase.hotPhaseDescriptionMessage"
defaultMessage={`This phase is required. You are actively querying and
writing to your index. For faster updates, you can roll over the index when it gets too big or too old.`}
defaultMessage="This phase is required. You are actively querying and writing to your
index. For faster updates, you can roll over the index when it gets too big or too old."
/>
</p>
</Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ class EditPolicyUi extends Component {
<p>
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.lifecyclePolicyDescriptionText"
defaultMessage={`Use an index policy to automate the four phases of the index lifecycle,
from actively writing to the index to deleting it.`}
defaultMessage="Use an index policy to automate the four phases of the index lifecycle,
from actively writing to the index to deleting it."
/>
{' '}
<LearnMoreLink
Expand Down Expand Up @@ -197,8 +197,9 @@ class EditPolicyUi extends Component {
.{' '}
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.editingExistingPolicyExplanationMessage"
defaultMessage={`Any changes you make will affect the indices that are attached to this policy.
Alternatively, you can save these changes in a new policy.`}
defaultMessage="Any changes you make will affect the indices that are
attached to this policy. Alternatively, you can save these changes in
a new policy."
/>
</p>
</EuiText>
Expand Down
Loading

0 comments on commit 1759396

Please sign in to comment.