Skip to content

Commit

Permalink
Translate some things on search (#1917)
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey authored Nov 16, 2023
1 parent 22b7642 commit fe1a718
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/view/screens/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ function Loader() {
)
}

// TODO refactor how to translate?
function EmptyState({message, error}: {message: string; error?: string}) {
const pal = usePalette('default')
const {isMobile} = useWebMediaQueries()
Expand Down Expand Up @@ -196,6 +195,7 @@ type SearchResultSlice =
}

function SearchScreenPostResults({query}: {query: string}) {
const {_} = useLingui()
const pal = usePalette('default')
const [isPTR, setIsPTR] = React.useState(false)
const {
Expand Down Expand Up @@ -246,7 +246,9 @@ function SearchScreenPostResults({query}: {query: string}) {

return error ? (
<EmptyState
message="We're sorry, but your search could not be completed. Please try again in a few minutes."
message={_(
msg`We're sorry, but your search could not be completed. Please try again in a few minutes.`,
)}
error={error.toString()}
/>
) : (
Expand Down Expand Up @@ -278,7 +280,7 @@ function SearchScreenPostResults({query}: {query: string}) {
contentContainerStyle={{paddingBottom: 100}}
/>
) : (
<EmptyState message={`No results found for ${query}`} />
<EmptyState message={_(msg`No results found for ${query}`)} />
)}
</>
) : (
Expand All @@ -289,6 +291,7 @@ function SearchScreenPostResults({query}: {query: string}) {
}

function SearchScreenUserResults({query}: {query: string}) {
const {_} = useLingui()
const [isFetched, setIsFetched] = React.useState(false)
const [dataUpdatedAt, setDataUpdatedAt] = React.useState(0)
const [results, setResults] = React.useState<
Expand Down Expand Up @@ -335,7 +338,7 @@ function SearchScreenUserResults({query}: {query: string}) {
contentContainerStyle={{paddingBottom: 100}}
/>
) : (
<EmptyState message={`No results found for ${query}`} />
<EmptyState message={_(msg`No results found for ${query}`)} />
)}
</>
) : (
Expand Down Expand Up @@ -587,7 +590,7 @@ export function SearchScreenMobile(
/>
))
) : (
<EmptyState message={`No results found for ${query}`} />
<EmptyState message={_(msg`No results found for ${query}`)} />
)}

<View style={{height: 200}} />
Expand Down
2 changes: 1 addition & 1 deletion src/view/shell/desktop/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function DesktopSearch() {
/>
<TextInput
testID="searchTextInput"
placeholder="Search"
placeholder={_(msg`Search`)}
placeholderTextColor={pal.colors.textLight}
selectTextOnFocus
returnKeyType="search"
Expand Down

0 comments on commit fe1a718

Please sign in to comment.