mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
* Translations for KueryBar * Fix code review comments * Use i18n.translate * Refactoring
This commit is contained in:
parent
72026bf5db
commit
ddb34705ed
2 changed files with 32 additions and 11 deletions
|
@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
|
|||
import Suggestions from './Suggestions';
|
||||
import ClickOutside from './ClickOutside';
|
||||
import { EuiFieldSearch, EuiProgress } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const KEY_CODES = {
|
||||
LEFT: 37,
|
||||
|
@ -166,7 +167,17 @@ export class Typeahead extends Component {
|
|||
style={{
|
||||
backgroundImage: 'none'
|
||||
}}
|
||||
placeholder="Search transactions and errors... (E.g. transaction.duration.us > 300000 AND context.response.status_code >= 400)"
|
||||
placeholder={i18n.translate(
|
||||
'xpack.apm.kueryBar.searchPlaceholder',
|
||||
{
|
||||
defaultMessage:
|
||||
'Search transactions and errors… (E.g. {queryExample})',
|
||||
values: {
|
||||
queryExample:
|
||||
'transaction.duration.us > 300000 AND context.response.status_code >= 400'
|
||||
}
|
||||
}
|
||||
)}
|
||||
inputRef={node => {
|
||||
if (node) {
|
||||
this.inputRef = node;
|
||||
|
|
|
@ -25,6 +25,8 @@ import {
|
|||
import styled from 'styled-components';
|
||||
|
||||
import { getBoolFilter } from './get_bool_filter';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
const Container = styled.div`
|
||||
margin-bottom: 10px;
|
||||
|
@ -112,16 +114,24 @@ class KueryBarView extends Component {
|
|||
style={{ display: 'inline-block', marginTop: '10px' }}
|
||||
title={
|
||||
<div>
|
||||
There's no APM index pattern with the title "
|
||||
{apmIndexPatternTitle}
|
||||
" available. To use the Query bar, please choose to import
|
||||
the APM index pattern via the{' '}
|
||||
<KibanaLink
|
||||
pathname={'/app/kibana'}
|
||||
hash={`/home/tutorial/apm`}
|
||||
>
|
||||
Setup Instructions.
|
||||
</KibanaLink>
|
||||
<FormattedMessage
|
||||
id="xpack.apm.kueryBar.indexPatternMissingWarningMessage"
|
||||
defaultMessage="There's no APM index pattern with the title {apmIndexPatternTitle} available. To use the Query bar, please choose to import the APM index pattern via the {setupInstructionsLink}."
|
||||
values={{
|
||||
apmIndexPatternTitle: `"${apmIndexPatternTitle}"`,
|
||||
setupInstructionsLink: (
|
||||
<KibanaLink
|
||||
pathname={'/app/kibana'}
|
||||
hash={`/home/tutorial/apm`}
|
||||
>
|
||||
{i18n.translate(
|
||||
'xpack.apm.kueryBar.setupInstructionsLinkLabel',
|
||||
{ defaultMessage: 'Setup Instructions' }
|
||||
)}
|
||||
</KibanaLink>
|
||||
)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
color="warning"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue