Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading