my fork of the bluesky client

Add option to search in any language (#5598)

authored by

Eric Bailey and committed by
GitHub
3f66531e ce53b3a2

+20 -9
+1
src/screens/Search/utils.ts
··· 35 35 return [ 36 36 query, 37 37 Object.entries(params) 38 + .filter(([_, value]) => value) 38 39 .map(([name, value]) => `${name}:${value}`) 39 40 .join(' '), 40 41 ]
+19 -9
src/view/screens/Search/Search.tsx
··· 338 338 onChange(value: string): void 339 339 }) { 340 340 const t = useThemeNew() 341 + const {_} = useLingui() 341 342 const {contentLanguages} = useLanguagePrefs() 342 343 343 344 const items = React.useMemo(() => { 344 - return LANGUAGES.filter(l => Boolean(l.code2)) 345 - .map(l => ({ 346 - label: l.name, 347 - inputLabel: l.name, 348 - value: l.code2, 349 - key: l.code2 + l.code3, 350 - })) 351 - .sort(a => (contentLanguages.includes(a.value) ? -1 : 1)) 352 - }, [contentLanguages]) 345 + return [ 346 + { 347 + label: _(msg`Any language`), 348 + inputLabel: _(msg`Any language`), 349 + value: '', 350 + key: '*', 351 + }, 352 + ].concat( 353 + LANGUAGES.filter(l => Boolean(l.code2)) 354 + .map(l => ({ 355 + label: l.name, 356 + inputLabel: l.name, 357 + value: l.code2, 358 + key: l.code2 + l.code3, 359 + })) 360 + .sort(a => (contentLanguages.includes(a.value) ? -1 : 1)), 361 + ) 362 + }, [_, contentLanguages]) 353 363 354 364 const style = { 355 365 backgroundColor: t.atoms.bg_contrast_25.backgroundColor,