Translate search

This commit is contained in:
MartinBraquet
2026-01-03 13:48:24 +02:00
parent 2ed23e05fa
commit 77e3b56b65
2 changed files with 14 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ import toast from "react-hot-toast";
import {FilterFields} from "common/filters";
import {DisplayUser} from "common/api/user-types";
import {useChoices} from "web/hooks/use-choices";
import {useT} from "web/lib/locale";
function isOrderBy(input: string): input is FilterFields['orderBy'] {
return ['last_online_time', 'created_time', 'compatibility_score'].includes(
@@ -134,6 +135,7 @@ export const Search = (props: {
const [isHolding, setIsHolding] = useState(false);
const [bookmarked, setBookmarked] = useState(false);
const [loadingBookmark, setLoadingBookmark] = useState(false);
const t = useT()
const [openBookmarks, setOpenBookmarks] = useState(false);
const [openStarBookmarks, setOpenStarBookmarks] = useState(false);
const user = useUser()
@@ -200,11 +202,11 @@ export const Search = (props: {
value={filters.orderBy || 'created_time'}
className={'w-18 border-ink-300 rounded-md'}
>
<option value="created_time">New</option>
<option value="created_time">{t('common.new', 'New')}</option>
{youProfile && (
<option value="compatibility_score">Compatible</option>
<option value="compatibility_score">{t('common.compatible', 'Compatible')}</option>
)}
<option value="last_online_time">Active</option>
<option value="last_online_time">{t('common.active', 'Active')}</option>
</Select>
<Button
color="none"
@@ -274,7 +276,7 @@ export const Search = (props: {
color={'none'}
className={'bg-canvas-100 hover:bg-canvas-200'}
>
{bookmarked ? 'Saved!' : loadingBookmark ? '' : 'Get Notified'}
{bookmarked ? t('common.saved', 'Saved!') : loadingBookmark ? '' : t('common.notified', 'Get Notified')}
</Button>
<BookmarkSearchButton
@@ -296,7 +298,7 @@ export const Search = (props: {
</Row>
{(profileCount ?? 0) > 0 && (
<Col className="text-sm text-ink-500">
<p>{profileCount} {(profileCount ?? 0) > 1 ? 'people' : 'person'}</p>
<p>{profileCount} {(profileCount ?? 0) > 1 ? t('common.people', 'people') : t('common.person', 'person')}</p>
</Col>
)}
</Row>

View File

@@ -848,6 +848,13 @@
"profile.comments.update_error": "Échec de la mise à jour des paramètres de recommandation",
"profile.comments.current_user_hint": "Les autres utilisateurs peuvent vous laisser des recommandations ici.",
"profile.comments.other_user_hint": "Si vous les connaissez, écrivez quelque chose de sympa qui enrichira leur profil.",
"common.new": "Nouveau",
"common.compatible": "Compatible",
"common.active": "Actif",
"common.saved": "Enregistré !",
"common.notified": "Être notifié",
"common.people": "personnes",
"common.person": "personne",
"profile.comments.feature_disabled_self": "Cette fonctionnalité est désactivée",
"profile.comments.feature_disabled_other": "{name} a désactivé les recommandations des autres utilisateurs.",
"multi-checkbox.search_or_add": "Chercher ou ajouter",