@@ -9,7 +9,7 @@ import { SEARCH_TYPE_DEFAULT } from "discourse/controllers/full-page-search";
99import { ajax } from " discourse/lib/ajax" ;
1010import { isValidSearchTerm , translateResults } from " discourse/lib/search" ;
1111import icon from " discourse-common/helpers/d-icon" ;
12- import I18n , { i18n } from " discourse-i18n" ;
12+ import { i18n } from " discourse-i18n" ;
1313import DTooltip from " float-kit/components/d-tooltip" ;
1414import AiIndicatorWave from " ./ai-indicator-wave" ;
1515
@@ -64,26 +64,26 @@ export default class AiFullPageSearch extends Component {
6464
6565 get searchStateText () {
6666 if (! this .validSearchOrder ) {
67- return I18n . t (
67+ return i18n (
6868 " discourse_ai.embeddings.semantic_search_results.unavailable"
6969 );
7070 }
7171
7272 // Search loading:
7373 if (this .searching ) {
74- return I18n . t (" discourse_ai.embeddings.semantic_search_loading" );
74+ return i18n (" discourse_ai.embeddings.semantic_search_loading" );
7575 }
7676
7777 // We have results and we are showing them
7878 if (this .AiResults .length && this .showingAiResults ) {
79- return I18n . t (" discourse_ai.embeddings.semantic_search_results.toggle" , {
79+ return i18n (" discourse_ai.embeddings.semantic_search_results.toggle" , {
8080 count: this .AiResults .length ,
8181 });
8282 }
8383
8484 // We have results but are hiding them
8585 if (this .AiResults .length && ! this .showingAiResults ) {
86- return I18n . t (
86+ return i18n (
8787 " discourse_ai.embeddings.semantic_search_results.toggle_hidden" ,
8888 {
8989 count: this .AiResults .length ,
@@ -96,12 +96,12 @@ export default class AiFullPageSearch extends Component {
9696 this .AiResults .length === 0 &&
9797 this .searchTerm !== this .initialSearchTerm
9898 ) {
99- return I18n . t (" discourse_ai.embeddings.semantic_search_results.new" );
99+ return i18n (" discourse_ai.embeddings.semantic_search_results.new" );
100100 }
101101
102102 // No results:
103103 if (this .AiResults .length === 0 ) {
104- return I18n . t (" discourse_ai.embeddings.semantic_search_results.none" );
104+ return i18n (" discourse_ai.embeddings.semantic_search_results.none" );
105105 }
106106 }
107107
@@ -121,6 +121,14 @@ export default class AiFullPageSearch extends Component {
121121 );
122122 }
123123
124+ get tooltipText () {
125+ return i18n (
126+ ` discourse_ai.embeddings.semantic_search_tooltips.${
127+ this .validSearchOrder ? " results_explanation" : " invalid_sort"
128+ } `
129+ );
130+ }
131+
124132 @action
125133 toggleAiResults () {
126134 if (this .showingAiResults ) {
@@ -201,22 +209,17 @@ export default class AiFullPageSearch extends Component {
201209 <AiIndicatorWave @ loading ={{this .searching }} />
202210 {{/if }}
203211
204- {{#unless this . validSearchOrder }}
205-
206- <DTooltip
207- @ identifier =" semantic-search-unavailable-tooltip"
208- class =" semantic-search__unavailable-tooltip"
209- >
210- <: trigger >
211- {{icon " far-circle-question" }}
212- </: trigger >
213- <: content >
214- {{i18n
215- " discourse_ai.embeddings.semantic_search_unavailable_tooltip"
216- }}
217- </: content >
218- </DTooltip >
219- {{/unless }}
212+ <DTooltip
213+ @ identifier =" semantic-search-tooltip"
214+ class =" semantic-search__tooltip"
215+ >
216+ <: trigger >
217+ {{icon " far-circle-question" }}
218+ </: trigger >
219+ <: content >
220+ {{this .tooltipText }}
221+ </: content >
222+ </DTooltip >
220223 </div >
221224 </div >
222225 </div >
0 commit comments