File tree Expand file tree Collapse file tree
vibes/soul/sections/not-found Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @bigcommerce/catalyst-core " : patch
3+ ---
4+
5+ Add translations for 'Search' button on 404 page
6+
7+ ## Migration
8+
9+ 1 . Add ` "search" ` translation key in the ` "NotFound" ` translations
10+ 2 . In ` core/vibes/soul/sections/not-found/index.tsx ` , add a ` ctaLabel ` property and ensure it is used in place of the "Search" text
11+ 3 . In ` core/app/[locale]/not-found.tsx ` , pass the ` ctaLabel ` prop as the new translation key ` ctaLabel={t('search')} `
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export default async function NotFound() {
1313
1414 < NotFoundSection
1515 className = "flex-1 place-content-center"
16+ ctaLabel = { t ( 'search' ) }
1617 subtitle = { t ( 'subtitle' ) }
1718 title = { t ( 'title' ) }
1819 />
Original file line number Diff line number Diff line change 423423 "NotFound" : {
424424 "title" : " We couldn't find that page!" ,
425425 "subtitle" : " Try searching for something else or go back to the home page." ,
426- "featuredProducts" : " Featured products"
426+ "featuredProducts" : " Featured products" ,
427+ "search" : " Search"
427428 },
428429 "Components" : {
429430 "Header" : {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { useSearch } from '~/context/search-context';
77export interface NotFoundProps {
88 title ?: string ;
99 subtitle ?: string ;
10+ ctaLabel ?: string ;
1011 className ?: string ;
1112}
1213
@@ -27,6 +28,7 @@ export interface NotFoundProps {
2728export function NotFound ( {
2829 title = 'Not found' ,
2930 subtitle = "Take a look around if you're lost." ,
31+ ctaLabel = 'Search' ,
3032 className = '' ,
3133} : NotFoundProps ) {
3234 const { setIsSearchOpen } = useSearch ( ) ;
@@ -44,7 +46,7 @@ export function NotFound({
4446 < p className = "mb-4 text-lg text-[var(--not-found-subtitle,hsl(var(--contrast-500)))]" >
4547 { subtitle }
4648 </ p >
47- < Button onClick = { handleOpenSearch } > Search </ Button >
49+ < Button onClick = { handleOpenSearch } > { ctaLabel } </ Button >
4850 </ header >
4951 </ SectionLayout >
5052 ) ;
You can’t perform that action at this time.
0 commit comments