fix: Modal-Titel in HelpTooltip übersetzt

- Modal-Titel verwendet jetzt Übersetzung (Hilfe/Help)
- Browser-Tooltip entfernt (nur noch custom Tooltip)
- useTranslations in HelpTooltip-Komponente integriert
This commit is contained in:
Hördle Bot
2025-12-04 01:09:48 +01:00
parent 65425ac15c
commit 4074cdfe00
3 changed files with 5 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
'use client'; 'use client';
import { useState, useRef, useEffect } from 'react'; import { useState, useRef, useEffect } from 'react';
import { useTranslations } from 'next-intl';
interface HelpTooltipProps { interface HelpTooltipProps {
shortText: string; // Text für Hover shortText: string; // Text für Hover
@@ -9,6 +10,7 @@ interface HelpTooltipProps {
} }
export default function HelpTooltip({ shortText, longText, position = 'top' }: HelpTooltipProps) { export default function HelpTooltip({ shortText, longText, position = 'top' }: HelpTooltipProps) {
const t = useTranslations('CuratorHelp');
const [showHover, setShowHover] = useState(false); const [showHover, setShowHover] = useState(false);
const [showModal, setShowModal] = useState(false); const [showModal, setShowModal] = useState(false);
const tooltipRef = useRef<HTMLDivElement>(null); const tooltipRef = useRef<HTMLDivElement>(null);
@@ -143,7 +145,7 @@ export default function HelpTooltip({ shortText, longText, position = 'top' }: H
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'start', marginBottom: '1rem' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'start', marginBottom: '1rem' }}>
<h3 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 'bold' }}>Hilfe</h3> <h3 style={{ margin: 0, fontSize: '1.25rem', fontWeight: 'bold' }}>{t('modalTitle')}</h3>
<button <button
type="button" type="button"
onClick={() => setShowModal(false)} onClick={() => setShowModal(false)}

View File

@@ -278,6 +278,7 @@
"title": "Kurator-Hilfe & Handbuch", "title": "Kurator-Hilfe & Handbuch",
"backToDashboard": "Zurück zum Dashboard", "backToDashboard": "Zurück zum Dashboard",
"helpButton": "Hilfe", "helpButton": "Hilfe",
"modalTitle": "Hilfe",
"introductionTitle": "Einführung", "introductionTitle": "Einführung",
"introductionText": "Als Kurator bist du verantwortlich für die Verwaltung von Songs in deinen zugewiesenen Genres und Specials. Dieses Dashboard ermöglicht es dir, Musik für das Hördle-Spiel hochzuladen, zu bearbeiten und zu organisieren.", "introductionText": "Als Kurator bist du verantwortlich für die Verwaltung von Songs in deinen zugewiesenen Genres und Specials. Dieses Dashboard ermöglicht es dir, Musik für das Hördle-Spiel hochzuladen, zu bearbeiten und zu organisieren.",
"permissionsTitle": "Deine Berechtigungen", "permissionsTitle": "Deine Berechtigungen",

View File

@@ -278,6 +278,7 @@
"title": "Curator Help & Manual", "title": "Curator Help & Manual",
"backToDashboard": "Back to Dashboard", "backToDashboard": "Back to Dashboard",
"helpButton": "Help", "helpButton": "Help",
"modalTitle": "Help",
"introductionTitle": "Introduction", "introductionTitle": "Introduction",
"introductionText": "As a curator, you are responsible for managing songs within your assigned genres and specials. This dashboard allows you to upload, edit, and organize music for the Hördle game.", "introductionText": "As a curator, you are responsible for managing songs within your assigned genres and specials. This dashboard allows you to upload, edit, and organize music for the Hördle game.",
"permissionsTitle": "Your Permissions", "permissionsTitle": "Your Permissions",