Skip to content

Commit 1088157

Browse files
authored
Merge pull request #1306 from algolia/bugfix/MAGE-558
bugfix: Fix for Translation in autocomplete (Ready to go)
2 parents de94943 + 6c4b4f9 commit 1088157

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

Block/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public function getConfiguration()
309309
'relevance' => __('Relevance'),
310310
'categories' => __('Categories'),
311311
'products' => __('Products'),
312+
'suggestions' => __('Suggestions'),
312313
'searchBy' => __('Search by'),
313314
'searchForFacetValuesPlaceholder' => __('Search for other ...'),
314315
'showMore' => __('Show more products'),

view/frontend/web/autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ define(
327327
}
328328

329329
if (algoliaConfig.autocomplete.nbOfQueriesSuggestions > 0) {
330-
algoliaConfig.autocomplete.sections.unshift({ hitsPerPage: algoliaConfig.autocomplete.nbOfQueriesSuggestions, label: '', name: "suggestions"});
330+
algoliaConfig.autocomplete.sections.unshift({ hitsPerPage: algoliaConfig.autocomplete.nbOfQueriesSuggestions, label: algoliaConfig.translations.suggestions, name: "suggestions"});
331331
}
332332

333333
/**

view/frontend/web/internals/template/autocomplete/additional-section.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
define([], function () {
22
return {
33
getNoResultHtml: function ({html}) {
4-
return html`<p>No Results</p>`;
4+
return html`<p>${algoliaConfig.translations.noResults}</p>`;
55
},
66

77
getHeaderHtml: function ({section}) {

view/frontend/web/internals/template/autocomplete/categories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
define([], function () {
22
return {
33
getNoResultHtml: function ({html}) {
4-
return html`<p>No Results</p>`;
4+
return html`<p>${algoliaConfig.translations.noResults}</p>`;
55
},
66

77
getHeaderHtml: function ({section}) {
8-
return section.name;
8+
return section.label;
99
},
1010

1111
getItemHtml: function ({item, components, html}) {

view/frontend/web/internals/template/autocomplete/pages.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
define([], function () {
22
return {
33
getNoResultHtml: function ({html}) {
4-
return html`<p>No Results</p>`;
4+
return html`<p>${algoliaConfig.translations.noResults}</p>`;
55
},
66

77
getHeaderHtml: function ({section}) {
8-
return section.label || section.name;
8+
return section.label;
99
},
1010

1111
getItemHtml: function ({item, components, html}) {

view/frontend/web/internals/template/autocomplete/products.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ define([], function () {
66
////////////////////
77

88
getNoResultHtml: function ({html}) {
9-
return html`<p>No Results</p>`;
9+
return html`<p>${algoliaConfig.translations.noResults}</p>`;
1010
},
1111

1212
getHeaderHtml: function () {

view/frontend/web/internals/template/autocomplete/suggestions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
define([], function () {
22
return {
33
getNoResultHtml: function ({html}) {
4-
return html`<p>No Results</p>`;
4+
return html`<p>${algoliaConfig.translations.noResults}</p>`;
55
},
66

77
getHeaderHtml: function ({section}) {
8-
return section.name;
8+
return section.label;
99
},
1010

1111
getItemHtml: function ({item, html}) {

0 commit comments

Comments
 (0)