Per the header call:
the localized title will be $announcement->getLocalizedTitle()
.
The currentTitle
(if translated) or currentTitleKey
(if a locale key) passes the title from the calling template to the breadcrumbs template. The only reason $title
worked in the previous instances was that each template used that variable as the title:
If you were dealing with a locale key rather than a translated locale string, you would pass this as an argument to currentTitleKey
rather than currentTitle
.
You can extend this same strategy to the search results.