From d7053dee1426e2e4b159c2dc440a70c1b2c58c7c Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Wed, 28 Jan 2026 12:27:14 +0100 Subject: [PATCH] Translate MoreOptionsUserButton --- .../buttons/more-options-user-button.tsx | 46 +++++++++++-------- web/messages/de.json | 12 +++++ web/messages/fr.json | 12 +++++ 3 files changed, 50 insertions(+), 20 deletions(-) diff --git a/web/components/buttons/more-options-user-button.tsx b/web/components/buttons/more-options-user-button.tsx index 27f37ee4..3a819c4e 100644 --- a/web/components/buttons/more-options-user-button.tsx +++ b/web/components/buttons/more-options-user-button.tsx @@ -18,6 +18,8 @@ import {buildArray} from 'common/util/array' import {DeleteYourselfButton} from '../profile/delete-yourself' import {toast} from "react-hot-toast"; import Router from "next/router"; +import {useT} from 'web/lib/locale' +import {Tooltip} from "web/components/widgets/tooltip"; export function MoreOptionsUserButton(props: { user: User }) { const {user} = props @@ -26,6 +28,7 @@ export function MoreOptionsUserButton(props: { user: User }) { const [isModalOpen, setIsModalOpen] = useState(false) const isAdmin = useAdmin() const isTrusted = useTrusted() + const t = useT() if (!currentPrivateUser) return
@@ -38,16 +41,19 @@ export function MoreOptionsUserButton(props: { user: User }) { return ( <> - + + + +
@@ -64,18 +70,18 @@ export function MoreOptionsUserButton(props: { user: User }) { unban: user.isBannedFromPosting ?? false, }), { - loading: 'Banning...', + loading: t('more_options_user.banning', 'Banning...'), success: () => { - return 'User banned!' + return t('more_options_user.user_banned', 'User banned!') }, error: () => { - return 'Error banning user' + return t('more_options_user.error_banning', 'Error banning user') }, } ) }} > - {user.isBannedFromPosting ? 'Banned' : 'Ban User'} + {user.isBannedFromPosting ? t('more_options_user.banned', 'Banned') : t('more_options_user.ban_user', 'Ban User')} )} @@ -96,11 +102,11 @@ export function MoreOptionsUserButton(props: { user: User }) { 'text-ink-600 flex-wrap items-center gap-x-3 gap-y-1 px-1' } > - Joined {createdTime} + {t('more_options_user.joined', 'Joined')} {createdTime} {isAdmin && ( @@ -113,7 +119,7 @@ export function MoreOptionsUserButton(props: { user: User }) { isYou ? [ { - title: 'Delete Account', + title: t('more_options_user.delete_account', 'Delete Account'), content: (
@@ -123,7 +129,7 @@ export function MoreOptionsUserButton(props: { user: User }) { ] : [ { - title: 'Block', + title: t('more_options_user.block', 'Block'), content: (