Skip to content

Commit

Permalink
Fix issues with dynamic content
Browse files Browse the repository at this point in the history
  • Loading branch information
devcshort committed Aug 23, 2023
1 parent 0db815f commit ab702d8
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
14 changes: 8 additions & 6 deletions packages/client/components/molecules/LocationAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ export function LocationAutocomplete(props: Props) {
<Flex align="center" mt="sm">
<Autocomplete
aria-label={
(t('search.location_placeholder') as string) ||
(t('search.location_placeholder', { ns: 'dynamic' }) as string) ||
''
t('search.location_placeholder', {
ns: 'dynamic',
defaultValue: t('search.location_placeholder'),
}) || ''
}
placeholder={
(t('search.location_placeholder') as string) ||
(t('search.location_placeholder', { ns: 'dynamic' }) as string) ||
''
t('search.location_placeholder', {
ns: 'dynamic',
defaultValue: t('search.location_placeholder'),
}) || ''
}
size="md"
value={value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,17 @@ export function TaxonomyAutocomplete({
<Autocomplete
{...rest}
aria-label={
(t('search.query_placeholder') as string) ||
(t('search.query_placeholder', { ns: 'dynamic' }) as string) ||
''
t('search.query_placeholder', {
ns: 'dynamic',
defaultValue: t('search.query_placeholder'),
}) || ''
}
icon={<IconSearch />}
placeholder={
(t('search.query_placeholder') as string) ||
(t('search.query_placeholder', { ns: 'dynamic' }) as string) ||
''
t('search.query_placeholder', {
ns: 'dynamic',
defaultValue: t('search.query_placeholder'),
}) || ''
}
filter={(value, item) => {
if (isTaxonomyCode.test(value)) {
Expand Down
6 changes: 4 additions & 2 deletions packages/client/components/organisms/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ export function HeroSection() {
sx={{ borderRadius: theme.radius.md }}
>
<Title order={1} size="h3" color="primary" mb="md">
{t('search.hero_title', { ns: 'common' }) ||
t('search.hero_title', { ns: 'dynamic' })}
{t('search.hero_title', {
ns: 'dynamic',
defaultValue: t('search.hero_title', { ns: 'common' }),
})}
</Title>

<HomePageSearch />
Expand Down
6 changes: 3 additions & 3 deletions packages/client/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"unable_to_delete_list_message": "Your list could not be deleted."
},
"search": {
"hero_title": "",
"query_placeholder": "",
"location_placeholder": "",
"hero_title": "Search for resources",
"query_placeholder": "Food, housing, etc...",
"location_placeholder": "City, state, or ZIP code",
"radius_placeholder": "Radius",
"miles": "Miles",
"any": "Any",
Expand Down
8 changes: 4 additions & 4 deletions packages/client/public/locales/en/dynamic.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"search.hero_title": "Where to Turn for Teens",
"search.hero_title": "Search for resources",
"search.query_placeholder": "What do you need help with?",
"search.location_placeholder": "City, state, zip, etc...",
"meta_title": "Teen Link",
"meta_description": "Teen Link is a program of Crisis Connections that serves youth in Washington State.",
"meta_title": "Community resources",
"meta_description": "",
"categories.0": "Alcohol, Drugs, and Substance Use",
"categories.0.subcategories.0": "Counseling/Treatment",
"categories.0.subcategories.1": "Support Groups",
Expand Down Expand Up @@ -55,4 +55,4 @@
"suggestions.11": "I need confidential access to a counselor.",
"suggestions.12": "I think I might be pregnant.",
"suggestions.13": "I’m being sexually harassed."
}
}

0 comments on commit ab702d8

Please sign in to comment.