Skip to content

Commit

Permalink
Fix dynamic uses of i18n and correct unprefixed i18n identifiers in q…
Browse files Browse the repository at this point in the history
…ueryEnhancements plugin (#8397)

* Fix dynamic uses of i18n and correct unprefixed i18n identifiers in queryEnhancements plugin

Signed-off-by: Miki <[email protected]>

* Changeset file for PR #8397 created/updated

---------

Signed-off-by: Miki <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
1 parent f3f007a commit 6f712e2
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8397.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Fix dynamic uses of i18n and correct unprefixed i18n identifiers in queryEnhancements plugin ([#8397](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8397))
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const EmptyIndexCallOut: React.FC<QueryAssistCallOutProps> = (props) => (
data-test-subj="query-assist-empty-index-callout"
title={
<FormattedMessage
id="queryAssist.callOut.emptyIndex.title"
id="queryEnhancements.callOut.emptyIndex.title"
defaultMessage="Select a data source or index to ask a question."
/>
}
Expand All @@ -44,7 +44,7 @@ const ProhibitedQueryCallOut: React.FC<QueryAssistCallOutProps> = (props) => (
data-test-subj="query-assist-guard-callout"
title={
<FormattedMessage
id="queryAssist.callOut.prohibitedQuery.title"
id="queryEnhancements.callOut.prohibitedQuery.title"
defaultMessage="I am unable to respond to this query. Try another question."
/>
}
Expand All @@ -62,7 +62,7 @@ const EmptyQueryCallOut: React.FC<QueryAssistCallOutProps> = (props) => (
data-test-subj="query-assist-empty-query-callout"
title={
<FormattedMessage
id="queryAssist.callOut.emptyQuery.title"
id="queryEnhancements.callOut.emptyQuery.title"
defaultMessage="Enter a natural language question to automatically generate a query to view results."
/>
}
Expand All @@ -80,7 +80,7 @@ const QueryGeneratedCallOut: React.FC<QueryAssistCallOutProps> = (props) => (
data-test-subj="query-assist-query-generated-callout"
title={
<FormattedMessage
id="queryAssist.callOut.queryGenerated.title"
id="queryEnhancements.callOut.queryGenerated.title"
defaultMessage="{language} query generated. If there are any issues with the response, try adding more context to the question or a new question to submit."
values={{ language: props.language }}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export const QueryAssistBanner: React.FC<QueryAssistBannerProps> = (props) => {
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBadge>
<FormattedMessage id="queryAssist.banner.badge" defaultMessage="New!" />
<FormattedMessage id="queryEnhancements.banner.badge" defaultMessage="New!" />
</EuiBadge>
</EuiFlexItem>
<EuiFlexItem>
<EuiTextColor color="default">
<FormattedMessage
id="queryAssist.banner.title.prefix"
id="queryEnhancements.banner.title.prefix"
defaultMessage="Use natural language to explore your data with "
/>
<EuiLink
Expand All @@ -66,7 +66,7 @@ export const QueryAssistBanner: React.FC<QueryAssistBannerProps> = (props) => {
}}
>
<FormattedMessage
id="queryAssist.banner.title.suffix"
id="queryEnhancements.banner.title.suffix"
defaultMessage="Natural Language Query Generation for {languages}"
values={{ languages: props.languages.join(', ') }}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ export const QueryAssistSummary: React.FC<QueryAssistSummaryProps> = (props) =>
type={'iInCircle'}
content={`Summary based on first ${sampleSize} records`}
aria-label={i18n.translate('queryEnhancements.queryAssist.summary.sampletip', {
defaultMessage: `Summary based on first ${sampleSize} records`,
defaultMessage: 'Summary based on first {sampleSize} records',
values: { sampleSize },
})}
/>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const createQueryAssistExtension = (
return {
type: DATA_STRUCTURE_META_TYPES.FEATURE,
icon: { type: assistantMark },
tooltip: i18n.translate('queryAssist.meta.icon.tooltip', {
tooltip: i18n.translate('queryEnhancements.meta.icon.tooltip', {
defaultMessage: 'Query assist is available',
}),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class QueryLanguageReference {
const button = (
<EuiButtonIcon
iconType={'iInCircle'}
aria-label={i18n.translate('discover.queryControls.languageReference', {
aria-label={i18n.translate('queryEnhancements.queryControls.languageReference', {
defaultMessage: `PPL language Reference`,
})}
onClick={() => {
Expand Down

0 comments on commit 6f712e2

Please sign in to comment.