Skip to content

Commit

Permalink
Translations for Advanced Settings (elastic#23881)
Browse files Browse the repository at this point in the history
* translate kbn.management.advanced_settings

* fix tests and update snapshots

* fix tests

* fix  issues

* fix id in get_category-name.js

* Update unit test snapshot

* update snapshot

* Fix issues
  • Loading branch information
Nox911 authored and maryia-lapata committed Oct 19, 2018
1 parent a5c28d5 commit 371eca2
Show file tree
Hide file tree
Showing 20 changed files with 1,167 additions and 716 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ import {
} from './components/default_component_registry';
import { getSettingsComponent } from './components/component_registry';

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

export class AdvancedSettings extends Component {
static propTypes = {
config: PropTypes.object.isRequired,
Expand Down Expand Up @@ -154,36 +156,38 @@ export class AdvancedSettings extends Component {
const PageFooter = getSettingsComponent(PAGE_FOOTER_COMPONENT);

return (
<EuiPage restrictWidth>
<div className="mgtAdvancedSettings">
<EuiFlexGroup gutterSize="none">
<EuiFlexItem>
<PageTitle />
</EuiFlexItem>
<EuiFlexItem>
<Search
query={query}
categories={this.categories}
onQueryChange={this.onQueryChange}
/>
</EuiFlexItem>
</EuiFlexGroup>
<PageSubtitle />
<EuiSpacer size="m" />
<CallOuts />
<EuiSpacer size="m" />
<Form
settings={filteredSettings}
categories={this.categories}
categoryCounts={this.categoryCounts}
clearQuery={this.clearQuery}
save={this.saveConfig}
clear={this.clearConfig}
showNoResultsMessage={!footerQueryMatched}
/>
<PageFooter query={query} onQueryMatchChange={this.onFooterQueryMatchChange} />
</div>
</EuiPage>
<I18nProvider>
<EuiPage restrictWidth>
<div className="mgtAdvancedSettings">
<EuiFlexGroup gutterSize="none">
<EuiFlexItem>
<PageTitle />
</EuiFlexItem>
<EuiFlexItem>
<Search
query={query}
categories={this.categories}
onQueryChange={this.onQueryChange}
/>
</EuiFlexItem>
</EuiFlexGroup>
<PageSubtitle />
<EuiSpacer size="m" />
<CallOuts />
<EuiSpacer size="m" />
<Form
settings={filteredSettings}
categories={this.categories}
categoryCounts={this.categoryCounts}
clearQuery={this.clearQuery}
save={this.saveConfig}
clear={this.clearConfig}
showNoResultsMessage={!footerQueryMatched}
/>
<PageFooter query={query} onQueryMatchChange={this.onFooterQueryMatchChange} />
</div>
</EuiPage>
</I18nProvider>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ exports[`CallOuts should render normally 1`] = `
color="warning"
iconType="bolt"
size="m"
title="Caution: You can break stuff here"
title={
<FormattedMessage
defaultMessage="Caution: You can break stuff here"
id="kbn.management.settings.callOutCautionTitle"
values={Object {}}
/>
}
>
<p>
Be careful in here, these settings are for very advanced users only. Tweaks you make here can break large portions of Kibana. Some of these settings may be undocumented, unsupported or experimental. If a field has a default value, blanking the field will reset it to its default which may be unacceptable given other configuration directives. Deleting a custom setting will permanently remove it from Kibana's config.
<FormattedMessage
defaultMessage="Be careful in here, these settings are for very advanced users only. Tweaks you make here can break large portions of Kibana. Some of these settings may be undocumented, unsupported or experimental. If a field has a default value, blanking the field will reset it to its default which may be unacceptable given other configuration directives. Deleting a custom setting will permanently remove it from Kibana's config."
id="kbn.management.settings.callOutCautionDescription"
values={Object {}}
/>
</p>
</EuiCallOut>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,31 @@ import React from 'react';
import {
EuiCallOut,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

export const CallOuts = () => {
return (
<div>
<EuiCallOut
title="Caution: You can break stuff here"
title={(
<FormattedMessage
id="kbn.management.settings.callOutCautionTitle"
defaultMessage="Caution: You can break stuff here"
/>
)}
color="warning"
iconType="bolt"
>
<p>
Be careful in here, these settings are for very advanced users only.
Tweaks you make here can break large portions of Kibana.
Some of these settings may be undocumented, unsupported or experimental.
If a field has a default value, blanking the field will reset it to its default which may be
unacceptable given other configuration directives.
Deleting a custom setting will permanently remove it from Kibana&apos;s config.
<FormattedMessage
id="kbn.management.settings.callOutCautionDescription"
defaultMessage="Be careful in here, these settings are for very advanced users only.
Tweaks you make here can break large portions of Kibana.
Some of these settings may be undocumented, unsupported or experimental.
If a field has a default value, blanking the field will reset it to its default which may be
unacceptable given other configuration directives.
Deleting a custom setting will permanently remove it from Kibana&apos;s config."
/>
</p>
</EuiCallOut>
</div>
Expand Down
Loading

0 comments on commit 371eca2

Please sign in to comment.