diff --git a/web/components/buttons/copy-link-button.tsx b/web/components/buttons/copy-link-button.tsx index e027228..3141356 100644 --- a/web/components/buttons/copy-link-button.tsx +++ b/web/components/buttons/copy-link-button.tsx @@ -1,21 +1,13 @@ -import { ComponentProps, useState } from 'react' -import { copyToClipboard } from 'web/lib/util/copy' -import { track } from 'web/lib/service/analytics' -import { Tooltip } from '../widgets/tooltip' +import {ComponentProps, useState} from 'react' +import {copyToClipboard} from 'web/lib/util/copy' +import {track} from 'web/lib/service/analytics' +import {Tooltip} from '../widgets/tooltip' import clsx from 'clsx' -import { - Button, - ColorType, - IconButton, - SizeType, -} from 'web/components/buttons/button' +import {Button, ColorType, IconButton, SizeType,} from 'web/components/buttons/button' import toast from 'react-hot-toast' import LinkIcon from 'web/lib/icons/link-icon.svg' -import { - CheckIcon, - ClipboardCopyIcon, - DuplicateIcon, -} from '@heroicons/react/outline' +import {CheckIcon, ClipboardCopyIcon, DuplicateIcon,} from '@heroicons/react/outline' +import {useT} from "web/lib/locale"; export function CopyLinkOrShareButton(props: { url: string @@ -33,6 +25,7 @@ export function CopyLinkOrShareButton(props: { const { url, size, children, className, iconClassName, tooltip, color } = props const [isSuccess, setIsSuccess] = useState(false) + const t = useT() const onClick = () => { if (!url) return @@ -41,12 +34,12 @@ export function CopyLinkOrShareButton(props: { setTimeout(() => setIsSuccess(false), 2000) // Reset after 2 seconds } - const content = isSuccess ? 'Copied!' : children + const content = isSuccess ? t('about.settings.copied', 'Copied!') : children return ( @@ -103,6 +96,7 @@ export const CopyLinkRow = (props: { // "copied" success state animations const [bgPressed, setBgPressed] = useState(false) const [iconPressed, setIconPressed] = useState(false) + const t = useT() const onClick = () => { if (!url) return @@ -112,7 +106,7 @@ export const CopyLinkRow = (props: { setTimeout(() => setBgPressed(false), 300) setTimeout(() => setIconPressed(false), 1000) copyToClipboard(url) - toast.success('Link copied!') + toast.success(t('copy_link_button.link_copied', 'Link copied!')) } // remove any http:// prefix @@ -152,18 +146,19 @@ export function SimpleCopyTextButton(props: { className?: string }) { const { text, eventTrackingName, className, tooltip } = props + const t = useT() const onClick = () => { if (!text) return copyToClipboard(text) - toast.success('Link copied!') + toast.success(t('copy_link_button.link_copied', 'Link copied!')) track(eventTrackingName, { text }) } return ( - + diff --git a/web/components/filters/search.tsx b/web/components/filters/search.tsx index df94e1a..4611cda 100644 --- a/web/components/filters/search.tsx +++ b/web/components/filters/search.tsx @@ -310,7 +310,8 @@ export const Search = (props: { /> {(profileCount ?? 0) > 0 && ( -

{profileCount} {(profileCount ?? 0) > 1 ? t('common.people', 'people') : t('common.person', 'person')}

diff --git a/web/messages/de.json b/web/messages/de.json index 02462ec..c261983 100644 --- a/web/messages/de.json +++ b/web/messages/de.json @@ -263,6 +263,8 @@ "home.subtitle": "Finden Sie Menschen, die Ihre Werte, Ideen und Absichten teilen — nicht nur Ihre Fotos.", "home.title": "Schluss mit Swipen.", "home.typewriter": "Suchen.", + "copy_link_button.copy_link": "Link kopieren", + "copy_link_button.link_copied": "Link kopiert!", "search.include_short_bios_tooltip": "Um alle Profile aufzulisten, aktivieren Sie \"Kurze Bios einbeziehen\"", "more_options_user.more_options": "Weitere Optionen", "more_options_user.banning": "Sperre...", diff --git a/web/messages/fr.json b/web/messages/fr.json index 2d3fc3f..d64f9cf 100644 --- a/web/messages/fr.json +++ b/web/messages/fr.json @@ -263,6 +263,8 @@ "home.subtitle": "Trouvez des personnes qui partagent vos valeurs, idées et intentions — pas seulement vos photos.", "home.title": "Fini les swipes.", "home.typewriter": "Cherche.", + "copy_link_button.copy_link": "Copier le lien", + "copy_link_button.link_copied": "Lien copié !", "search.include_short_bios_tooltip": "Pour lister tous les profils, cochez \"Inclure les bios courtes\"", "more_options_user.more_options": "Plus d'options", "more_options_user.banning": "Bannissement...",