Skip to content

Commit

Permalink
search bar: add language parameter
Browse files Browse the repository at this point in the history
The suggestions in the auto-complete search bar
presents the data according to the current language.

- closes rero/rero-ils#1509

Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch>
  • Loading branch information
Garfield-fr committed Jan 5, 2021
1 parent d7ace51 commit 23e74fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { SearchBarConfigService } from '@rero/shared';
})
export class SearchBarComponent implements OnInit {

@Input() language: string;
@Input() viewcode: string;
@Input() size: string = undefined;
@Input() placeholder: string;
Expand All @@ -49,6 +50,9 @@ export class SearchBarComponent implements OnInit {
}

ngOnInit() {
if (this.language) {
this._translateService.use(this.language);
}
this.recordTypes = this._searchBarConfigService.getConfig(
false, this, this.viewcode, this.maxLengthSuggestion
);
Expand Down
2 changes: 1 addition & 1 deletion projects/public-search/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</li>
</ul>
</div>
<main-search-bar viewcode="global"></main-search-bar>
<main-search-bar viewcode="global" language="en"></main-search-bar>
</nav>
<public-search-root></public-search-root>
</div>
Expand Down

0 comments on commit 23e74fe

Please sign in to comment.