로컬라이제이션 적용 (영어 / 한국어 )

This commit is contained in:
HyeongBaeYang committed 2026-02-10 14:39:58 +09:00
1 parent 29fdb7e65c
commit ad6f9e09a1
30 files changed
+1474 -309

No files matched your search

+116 -25
View File
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
// =====================================================
// Types
@@ -263,6 +264,7 @@ const formatNumber = (num: number): string => {
};
const YearOverYearChart: React.FC<{ data: MonthlyData[] }> = ({ data }) => {
const { t } = useTranslation();
const [tooltip, setTooltip] = useState<TooltipData | null>(null);
const [isAnimated, setIsAnimated] = useState(false);
@@ -420,12 +422,12 @@ const YearOverYearChart: React.FC<{ data: MonthlyData[] }> = ({ data }) => {
<div className="chart-tooltip-title">{tooltip.month}</div>
<div className="chart-tooltip-row">
<span className="chart-tooltip-dot mint"></span>
<span className="chart-tooltip-label">올해</span>
<span className="chart-tooltip-label">{t('dashboard.thisYear')}</span>
<span className="chart-tooltip-value">{formatNumber(tooltip.thisYear)}</span>
</div>
<div className="chart-tooltip-row">
<span className="chart-tooltip-dot purple"></span>
<span className="chart-tooltip-label">작년</span>
<span className="chart-tooltip-label">{t('dashboard.lastYear')}</span>
<span className="chart-tooltip-value">{formatNumber(tooltip.lastYear)}</span>
</div>
<div className="chart-tooltip-change">
@@ -517,6 +519,7 @@ const AudienceBarChart: React.FC<{ data: { label: string; percentage: number }[]
};
const GenderChart: React.FC<{ male: number; female: number; delay?: number }> = ({ male, female, delay = 0 }) => {
const { t } = useTranslation();
const [isAnimated, setIsAnimated] = useState(false);
useEffect(() => {
@@ -535,8 +538,8 @@ const GenderChart: React.FC<{ male: number; female: number; delay?: number }> =
</div>
</div>
<div className="gender-chart-labels">
<span className="gender-label male">남성</span>
<span className="gender-label female">여성</span>
<span className="gender-label male">{t('dashboard.male')}</span>
<span className="gender-label female">{t('dashboard.female')}</span>
</div>
</div>
);
@@ -547,9 +550,97 @@ const GenderChart: React.FC<{ male: number; female: number; delay?: number }> =
// =====================================================
const DashboardContent: React.FC = () => {
const { t } = useTranslation();
const [selectedPlatform, setSelectedPlatform] = useState<'youtube' | 'instagram'>('youtube');
const currentPlatformData = PLATFORM_DATA.find(p => p.platform === selectedPlatform);
// Translated content metrics
const contentMetrics: ContentMetric[] = [
{ id: 'impressions', label: t('dashboard.metricImpressions'), labelEn: 'IMPRESSIONS', value: '2.4M', trend: 12.5, trendDirection: 'up' },
{ id: 'reach', label: t('dashboard.metricReach'), labelEn: 'REACH', value: '1.8M', trend: 9.2, trendDirection: 'up' },
{ id: 'likes', label: t('dashboard.metricLikes'), labelEn: 'LIKES', value: '158.2K', trend: 8.3, trendDirection: 'up' },
{ id: 'comments', label: t('dashboard.metricComments'), labelEn: 'COMMENTS', value: '24.9K', trend: 2.1, trendDirection: 'down' },
{ id: 'shares', label: t('dashboard.metricShares'), labelEn: 'SHARES', value: '8.4K', trend: 15.7, trendDirection: 'up' },
{ id: 'saves', label: t('dashboard.metricSaves'), labelEn: 'SAVES', value: '12.3K', trend: 22.4, trendDirection: 'up' },
{ id: 'engagement', label: t('dashboard.metricEngagement'), labelEn: 'ENGAGEMENT', value: '4.8%', trend: 0.5, trendDirection: 'up' },
{ id: 'content', label: t('dashboard.metricContent'), labelEn: 'CONTENT', value: '127', trend: 4, trendDirection: 'up' },
];
// Translated monthly data
const monthlyData: MonthlyData[] = [
{ month: t('dashboard.months.jan'), thisYear: 180000, lastYear: 145000 },
{ month: t('dashboard.months.feb'), thisYear: 195000, lastYear: 158000 },
{ month: t('dashboard.months.mar'), thisYear: 210000, lastYear: 172000 },
{ month: t('dashboard.months.apr'), thisYear: 185000, lastYear: 168000 },
{ month: t('dashboard.months.may'), thisYear: 240000, lastYear: 195000 },
{ month: t('dashboard.months.jun'), thisYear: 275000, lastYear: 210000 },
{ month: t('dashboard.months.jul'), thisYear: 320000, lastYear: 235000 },
{ month: t('dashboard.months.aug'), thisYear: 295000, lastYear: 248000 },
{ month: t('dashboard.months.sep'), thisYear: 310000, lastYear: 262000 },
{ month: t('dashboard.months.oct'), thisYear: 285000, lastYear: 255000 },
{ month: t('dashboard.months.nov'), thisYear: 340000, lastYear: 278000 },
{ month: t('dashboard.months.dec'), thisYear: 380000, lastYear: 295000 },
];
// Translated platform data
const platformData: PlatformData[] = [
{
platform: 'youtube',
displayName: 'YouTube',
metrics: [
{ id: 'views', label: t('dashboard.youtubeMetrics.views'), value: '1.25M', trend: 18.2, trendDirection: 'up' },
{ id: 'watchTime', label: t('dashboard.youtubeMetrics.watchTime'), value: '4,820', unit: t('dashboard.youtubeMetrics.watchTimeUnit'), trend: 12.5, trendDirection: 'up' },
{ id: 'avgViewDuration', label: t('dashboard.youtubeMetrics.avgViewDuration'), value: '3:24', trend: 5.2, trendDirection: 'up' },
{ id: 'subscribers', label: t('dashboard.youtubeMetrics.subscribers'), value: '45.2K', trend: 5.8, trendDirection: 'up' },
{ id: 'newSubscribers', label: t('dashboard.youtubeMetrics.newSubscribers'), value: '1.2K', trend: 12.3, trendDirection: 'up' },
{ id: 'engagement', label: t('dashboard.youtubeMetrics.engagement'), value: '4.8', unit: '%', trend: 0.3, trendDirection: 'up' },
{ id: 'ctr', label: t('dashboard.youtubeMetrics.ctr'), value: '6.2', unit: '%', trend: 1.1, trendDirection: 'up' },
{ id: 'revenue', label: t('dashboard.youtubeMetrics.revenue'), value: '₩2.4M', trend: 8.5, trendDirection: 'up' },
],
},
{
platform: 'instagram',
displayName: 'Instagram',
metrics: [
{ id: 'reach', label: t('dashboard.instagramMetrics.reach'), value: '892K', trend: 22.4, trendDirection: 'up' },
{ id: 'impressions', label: t('dashboard.instagramMetrics.impressions'), value: '1.58M', trend: 15.1, trendDirection: 'up' },
{ id: 'profileVisits', label: t('dashboard.instagramMetrics.profileVisits'), value: '28.4K', trend: 18.7, trendDirection: 'up' },
{ id: 'followers', label: t('dashboard.instagramMetrics.followers'), value: '28.5K', trend: 8.2, trendDirection: 'up' },
{ id: 'newFollowers', label: t('dashboard.instagramMetrics.newFollowers'), value: '892', trend: 15.6, trendDirection: 'up' },
{ id: 'storyViews', label: t('dashboard.instagramMetrics.storyViews'), value: '156K', trend: 3.2, trendDirection: 'down' },
{ id: 'reelPlays', label: t('dashboard.instagramMetrics.reelPlays'), value: '423K', trend: 45.2, trendDirection: 'up' },
{ id: 'websiteClicks', label: t('dashboard.instagramMetrics.websiteClicks'), value: '3.2K', trend: 11.8, trendDirection: 'up' },
],
},
];
// Translated top content
const topContent: TopContent[] = [
{ id: '1', title: t('dashboard.topContentTitles.winterPromotion'), thumbnail: 'https://picsum.photos/seed/content1/120/68', platform: 'youtube', views: '125.4K', engagement: '8.2%', date: '2025.01.15' },
{ id: '2', title: t('dashboard.topContentTitles.stayIntroReel'), thumbnail: 'https://picsum.photos/seed/content2/120/68', platform: 'instagram', views: '89.2K', engagement: '12.5%', date: '2025.01.22' },
{ id: '3', title: t('dashboard.topContentTitles.newYearEvent'), thumbnail: 'https://picsum.photos/seed/content3/120/68', platform: 'youtube', views: '67.8K', engagement: '6.4%', date: '2025.01.08' },
{ id: '4', title: t('dashboard.topContentTitles.nightTimelapse'), thumbnail: 'https://picsum.photos/seed/content4/120/68', platform: 'instagram', views: '54.3K', engagement: '15.8%', date: '2025.01.28' },
];
// Translated audience data
const audienceData: AudienceData = {
ageGroups: [
{ label: '18-24', percentage: 12 },
{ label: '25-34', percentage: 35 },
{ label: '35-44', percentage: 28 },
{ label: '45-54', percentage: 18 },
{ label: '55+', percentage: 7 },
],
gender: { male: 42, female: 58 },
topRegions: [
{ region: t('dashboard.regions.seoul'), percentage: 32 },
{ region: t('dashboard.regions.gyeonggi'), percentage: 24 },
{ region: t('dashboard.regions.busan'), percentage: 12 },
{ region: t('dashboard.regions.incheon'), percentage: 8 },
{ region: t('dashboard.regions.daegu'), percentage: 6 },
],
};
const currentPlatformData = platformData.find(p => p.platform === selectedPlatform);
const lastUpdated = new Date().toLocaleDateString('ko-KR', {
year: 'numeric',
month: '2-digit',
@@ -564,18 +655,18 @@ const DashboardContent: React.FC = () => {
<AnimatedSection delay={0}>
<div className="dashboard-header-row">
<div>
<h1 className="dashboard-title">대시보드</h1>
<p className="dashboard-description">실시간 마케팅 퍼포먼스를 확인하세요.</p>
<h1 className="dashboard-title">{t('dashboard.title')}</h1>
<p className="dashboard-description">{t('dashboard.description')}</p>
</div>
<span className="dashboard-last-updated">마지막 업데이트: {lastUpdated}</span>
<span className="dashboard-last-updated">{t('dashboard.lastUpdated')} {lastUpdated}</span>
</div>
</AnimatedSection>
{/* Content Performance Section */}
<AnimatedSection delay={100} className="dashboard-section">
<h2 className="dashboard-section-title">콘텐츠 성과</h2>
<h2 className="dashboard-section-title">{t('dashboard.contentPerformance')}</h2>
<div className="stats-grid-8">
{CONTENT_METRICS.map((metric, index) => (
{contentMetrics.map((metric, index) => (
<AnimatedItem key={metric.id} index={index} baseDelay={200}>
<StatCard {...metric} />
</AnimatedItem>
@@ -589,23 +680,23 @@ const DashboardContent: React.FC = () => {
<AnimatedSection delay={600}>
<div className="yoy-chart-card">
<div className="yoy-chart-header">
<h2 className="dashboard-section-title">전년 대비 성장</h2>
<h2 className="dashboard-section-title">{t('dashboard.yearOverYear')}</h2>
<div className="chart-legend-dual">
<div className="chart-legend-item">
<span className="chart-legend-line solid"></span>
<span className="chart-legend-text">올해</span>
<span className="chart-legend-text">{t('dashboard.thisYear')}</span>
</div>
<div className="chart-legend-item">
<span className="chart-legend-line dashed"></span>
<span className="chart-legend-text">작년</span>
<span className="chart-legend-text">{t('dashboard.lastYear')}</span>
</div>
</div>
</div>
<div className="yoy-chart-container">
<YearOverYearChart data={MONTHLY_DATA} />
<YearOverYearChart data={monthlyData} />
</div>
<div className="yoy-chart-xaxis">
{MONTHLY_DATA.map(d => (
{monthlyData.map(d => (
<span key={d.month}>{d.month}</span>
))}
</div>
@@ -615,9 +706,9 @@ const DashboardContent: React.FC = () => {
{/* Top Content Section */}
<AnimatedSection delay={700}>
<div className="top-content-card">
<h2 className="dashboard-section-title">인기 콘텐츠</h2>
<h2 className="dashboard-section-title">{t('dashboard.popularContent')}</h2>
<div className="top-content-list">
{TOP_CONTENT.map((content, index) => (
{topContent.map((content, index) => (
<AnimatedItem key={content.id} index={index} baseDelay={800}>
<TopContentItem {...content} />
</AnimatedItem>
@@ -629,24 +720,24 @@ const DashboardContent: React.FC = () => {
{/* Audience Insights Section */}
<AnimatedSection delay={1000} className="audience-section">
<h2 className="dashboard-section-title">오디언스 인사이트</h2>
<h2 className="dashboard-section-title">{t('dashboard.audienceInsights')}</h2>
<div className="audience-cards">
<AnimatedItem index={0} baseDelay={1100}>
<div className="audience-card">
<h3 className="audience-card-title">연령대 분포</h3>
<AudienceBarChart data={AUDIENCE_DATA.ageGroups} delay={1200} />
<h3 className="audience-card-title">{t('dashboard.ageDistribution')}</h3>
<AudienceBarChart data={audienceData.ageGroups} delay={1200} />
</div>
</AnimatedItem>
<AnimatedItem index={1} baseDelay={1100}>
<div className="audience-card">
<h3 className="audience-card-title">성별 분포</h3>
<GenderChart male={AUDIENCE_DATA.gender.male} female={AUDIENCE_DATA.gender.female} delay={1300} />
<h3 className="audience-card-title">{t('dashboard.genderDistribution')}</h3>
<GenderChart male={audienceData.gender.male} female={audienceData.gender.female} delay={1300} />
</div>
</AnimatedItem>
<AnimatedItem index={2} baseDelay={1100}>
<div className="audience-card">
<h3 className="audience-card-title">상위 지역</h3>
<AudienceBarChart data={AUDIENCE_DATA.topRegions.map(r => ({ label: r.region, percentage: r.percentage }))} delay={1400} />
<h3 className="audience-card-title">{t('dashboard.topRegions')}</h3>
<AudienceBarChart data={audienceData.topRegions.map(r => ({ label: r.region, percentage: r.percentage }))} delay={1400} />
</div>
</AnimatedItem>
</div>
@@ -656,7 +747,7 @@ const DashboardContent: React.FC = () => {
<AnimatedSection delay={1300}>
<div className="platform-section-card">
<div className="platform-section-header">
<h2 className="dashboard-section-title">플랫폼별 지표</h2>
<h2 className="dashboard-section-title">{t('dashboard.platformMetrics')}</h2>
<div className="platform-tabs">
<button
className={`platform-tab ${selectedPlatform === 'youtube' ? 'active' : ''}`}