Skip to content

Commit

Permalink
[i18n] Translate Query_bar (#26264) (#26756)
Browse files Browse the repository at this point in the history
* Translate ui -> query_bar

* Fix id names

* Update snapshots

* Fix tests

* Add intl to props interface

* Fix test

* Fix tests

* Fix tests

* Fix test

* Fix tests
  • Loading branch information
maryia-lapata authored and Nox911 committed Dec 6, 2018
1 parent b82bf82 commit 776eacd
Show file tree
Hide file tree
Showing 6 changed files with 233 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
size="xs"
type="button"
>
Options
<FormattedMessage
defaultMessage="Options"
id="common.ui.queryBar.optionsButtonLabel"
values={Object {}}
/>
</EuiButtonEmpty>
}
className="eui-displayBlock"
Expand All @@ -24,7 +28,11 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
withTitle={true}
>
<EuiPopoverTitle>
Syntax options
<FormattedMessage
defaultMessage="Syntax options"
id="common.ui.queryBar.syntaxOptionsTitle"
values={Object {}}
/>
</EuiPopoverTitle>
<div
style={
Expand All @@ -38,17 +46,27 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
size="m"
>
<p>
Our experimental autocomplete and simple syntax features can help you create your queries. Just start typing and you’ll see matches related to your data. See docs
<EuiLink
color="primary"
href="https://www.elastic.co/guide/en/kibana/foo/kuery-query.html"
target="_blank"
type="button"
>
here
</EuiLink>
.
<FormattedMessage
defaultMessage="Our experimental autocomplete and simple syntax features can help you create your
queries. Just start typing and you’ll see matches related to your data. See docs {docsLink}."
id="common.ui.queryBar.syntaxOptionsDescription"
values={
Object {
"docsLink": <EuiLink
color="primary"
href="https://www.elastic.co/guide/en/kibana/foo/kuery-query.html"
target="_blank"
type="button"
>
<FormattedMessage
defaultMessage="here"
id="common.ui.queryBar.syntaxOptionsDescription.docsLinkText"
values={Object {}}
/>
</EuiLink>,
}
}
/>
</p>
</EuiText>
<EuiSpacer
Expand All @@ -64,7 +82,13 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
checked={false}
data-test-subj="languageToggle"
id="queryEnhancementOptIn"
label="Turn on query features"
label={
<FormattedMessage
defaultMessage="Turn on query features"
id="common.ui.queryBar.turnOnQueryFeaturesLabel"
values={Object {}}
/>
}
name="popswitch"
onChange={[Function]}
/>
Expand All @@ -79,17 +103,26 @@ exports[`LanguageSwitcher should toggle off if language is lucene 1`] = `
size="xs"
>
<p>
Not ready yet? Find our lucene docs
<EuiLink
color="primary"
href="https://www.elastic.co/guide/en/elasticsearch/reference/foo/query-dsl-query-string-query.html#query-string-syntax"
target="_blank"
type="button"
>
here
</EuiLink>
.
<FormattedMessage
defaultMessage="Not ready yet? Find our lucene docs {docsLink}."
id="common.ui.queryBar.luceneDocsDescription"
values={
Object {
"docsLink": <EuiLink
color="primary"
href="https://www.elastic.co/guide/en/elasticsearch/reference/foo/query-dsl-query-string-query.html#query-string-syntax"
target="_blank"
type="button"
>
<FormattedMessage
defaultMessage="here"
id="common.ui.queryBar.luceneDocsDescription.docsLinkText"
values={Object {}}
/>
</EuiLink>,
}
}
/>
</p>
</EuiText>
</div>
Expand All @@ -107,7 +140,11 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
size="xs"
type="button"
>
Options
<FormattedMessage
defaultMessage="Options"
id="common.ui.queryBar.optionsButtonLabel"
values={Object {}}
/>
</EuiButtonEmpty>
}
className="eui-displayBlock"
Expand All @@ -120,7 +157,11 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
withTitle={true}
>
<EuiPopoverTitle>
Syntax options
<FormattedMessage
defaultMessage="Syntax options"
id="common.ui.queryBar.syntaxOptionsTitle"
values={Object {}}
/>
</EuiPopoverTitle>
<div
style={
Expand All @@ -134,17 +175,27 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
size="m"
>
<p>
Our experimental autocomplete and simple syntax features can help you create your queries. Just start typing and you’ll see matches related to your data. See docs
<EuiLink
color="primary"
href="https://www.elastic.co/guide/en/kibana/foo/kuery-query.html"
target="_blank"
type="button"
>
here
</EuiLink>
.
<FormattedMessage
defaultMessage="Our experimental autocomplete and simple syntax features can help you create your
queries. Just start typing and you’ll see matches related to your data. See docs {docsLink}."
id="common.ui.queryBar.syntaxOptionsDescription"
values={
Object {
"docsLink": <EuiLink
color="primary"
href="https://www.elastic.co/guide/en/kibana/foo/kuery-query.html"
target="_blank"
type="button"
>
<FormattedMessage
defaultMessage="here"
id="common.ui.queryBar.syntaxOptionsDescription.docsLinkText"
values={Object {}}
/>
</EuiLink>,
}
}
/>
</p>
</EuiText>
<EuiSpacer
Expand All @@ -160,7 +211,13 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
checked={true}
data-test-subj="languageToggle"
id="queryEnhancementOptIn"
label="Turn on query features"
label={
<FormattedMessage
defaultMessage="Turn on query features"
id="common.ui.queryBar.turnOnQueryFeaturesLabel"
values={Object {}}
/>
}
name="popswitch"
onChange={[Function]}
/>
Expand All @@ -175,17 +232,26 @@ exports[`LanguageSwitcher should toggle on if language is kuery 1`] = `
size="xs"
>
<p>
Not ready yet? Find our lucene docs
<EuiLink
color="primary"
href="https://www.elastic.co/guide/en/elasticsearch/reference/foo/query-dsl-query-string-query.html#query-string-syntax"
target="_blank"
type="button"
>
here
</EuiLink>
.
<FormattedMessage
defaultMessage="Not ready yet? Find our lucene docs {docsLink}."
id="common.ui.queryBar.luceneDocsDescription"
values={
Object {
"docsLink": <EuiLink
color="primary"
href="https://www.elastic.co/guide/en/elasticsearch/reference/foo/query-dsl-query-string-query.html#query-string-syntax"
target="_blank"
type="button"
>
<FormattedMessage
defaultMessage="here"
id="common.ui.queryBar.luceneDocsDescription.docsLinkText"
values={Object {}}
/>
</EuiLink>,
}
}
/>
</p>
</EuiText>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ exports[`QueryBar Should disable autoFocus on EuiFieldText when disableAutoFocus
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
placeholder="Search... (e.g. status:200 AND extension:PHP)"
placeholder="Search (e.g. status:200 AND extension:PHP)"
role="textbox"
spellCheck={false}
type="text"
Expand Down Expand Up @@ -98,7 +98,11 @@ exports[`QueryBar Should disable autoFocus on EuiFieldText when disableAutoFocus
onClick={[Function]}
type="button"
>
Refresh
<FormattedMessage
defaultMessage="Refresh"
id="common.ui.queryBar.refreshButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down Expand Up @@ -161,7 +165,7 @@ exports[`QueryBar Should pass the query language to the language switcher 1`] =
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
placeholder="Search... (e.g. status:200 AND extension:PHP)"
placeholder="Search (e.g. status:200 AND extension:PHP)"
role="textbox"
spellCheck={false}
type="text"
Expand Down Expand Up @@ -202,7 +206,11 @@ exports[`QueryBar Should pass the query language to the language switcher 1`] =
onClick={[Function]}
type="button"
>
Refresh
<FormattedMessage
defaultMessage="Refresh"
id="common.ui.queryBar.refreshButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down Expand Up @@ -265,7 +273,7 @@ exports[`QueryBar Should render the given query 1`] = `
onClick={[Function]}
onKeyDown={[Function]}
onKeyUp={[Function]}
placeholder="Search... (e.g. status:200 AND extension:PHP)"
placeholder="Search (e.g. status:200 AND extension:PHP)"
role="textbox"
spellCheck={false}
type="text"
Expand Down Expand Up @@ -306,7 +314,11 @@ exports[`QueryBar Should render the given query 1`] = `
onClick={[Function]}
type="button"
>
Refresh
<FormattedMessage
defaultMessage="Refresh"
id="common.ui.queryBar.refreshButtonLabel"
values={Object {}}
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Loading

0 comments on commit 776eacd

Please sign in to comment.