Implementiere i18n für Frontend, Admin und Datenbank
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { driver } from 'driver.js';
|
||||
import 'driver.js/dist/driver.css';
|
||||
|
||||
export default function OnboardingTour() {
|
||||
const t = useTranslations('OnboardingTour');
|
||||
|
||||
useEffect(() => {
|
||||
const hasCompletedOnboarding = localStorage.getItem('hoerdle_onboarding_completed');
|
||||
|
||||
@@ -16,9 +19,9 @@ export default function OnboardingTour() {
|
||||
showProgress: true,
|
||||
animate: true,
|
||||
allowClose: true,
|
||||
doneBtnText: 'Done',
|
||||
nextBtnText: 'Next',
|
||||
prevBtnText: 'Previous',
|
||||
doneBtnText: t('done'),
|
||||
nextBtnText: t('next'),
|
||||
prevBtnText: t('previous'),
|
||||
onDestroyed: () => {
|
||||
localStorage.setItem('hoerdle_onboarding_completed', 'true');
|
||||
},
|
||||
@@ -26,8 +29,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-genres',
|
||||
popover: {
|
||||
title: 'Genres & Specials',
|
||||
description: 'Choose a specific genre or a curated special event here.',
|
||||
title: t('genresSpecials'),
|
||||
description: t('genresSpecialsDescription'),
|
||||
side: 'bottom',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -35,8 +38,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-news',
|
||||
popover: {
|
||||
title: 'News',
|
||||
description: 'Stay updated with the latest news and announcements.',
|
||||
title: t('news'),
|
||||
description: t('newsDescription'),
|
||||
side: 'top',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -44,8 +47,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-title',
|
||||
popover: {
|
||||
title: 'Hördle',
|
||||
description: 'This is the daily puzzle. One new song every day per genre.',
|
||||
title: t('hoerdle'),
|
||||
description: t('hoerdleDescription'),
|
||||
side: 'bottom',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -53,8 +56,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-status',
|
||||
popover: {
|
||||
title: 'Attempts',
|
||||
description: 'You have a limited number of attempts to guess the song.',
|
||||
title: t('attempts'),
|
||||
description: t('attemptsDescription'),
|
||||
side: 'bottom',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -62,8 +65,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-score',
|
||||
popover: {
|
||||
title: 'Score',
|
||||
description: 'Your current score. Try to keep it high!',
|
||||
title: t('score'),
|
||||
description: t('scoreDescription'),
|
||||
side: 'bottom',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -71,8 +74,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-player',
|
||||
popover: {
|
||||
title: 'Player',
|
||||
description: 'Listen to the snippet. Each additional play reduces your potential score.',
|
||||
title: t('player'),
|
||||
description: t('playerDescription'),
|
||||
side: 'top',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -80,8 +83,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-input',
|
||||
popover: {
|
||||
title: 'Input',
|
||||
description: 'Type your guess here. Search for artist or title.',
|
||||
title: t('input'),
|
||||
description: t('inputDescription'),
|
||||
side: 'top',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -89,8 +92,8 @@ export default function OnboardingTour() {
|
||||
{
|
||||
element: '#tour-controls',
|
||||
popover: {
|
||||
title: 'Controls',
|
||||
description: 'Start the music or skip to the next snippet if you\'re stuck.',
|
||||
title: t('controls'),
|
||||
description: t('controlsDescription'),
|
||||
side: 'top',
|
||||
align: 'start'
|
||||
}
|
||||
@@ -103,7 +106,7 @@ export default function OnboardingTour() {
|
||||
driverObj.drive();
|
||||
}, 1000);
|
||||
|
||||
}, []);
|
||||
}, [t]);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user