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

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

+7 -5
View File
@@ -1,7 +1,9 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
const Footer: React.FC = () => {
const { t } = useTranslation();
return (
<footer className="landing-footer">
<div className="footer-content">
@@ -10,11 +12,11 @@ const Footer: React.FC = () => {
<p className="footer-copyright">Copyright ⓒ O2O Inc. All rights reserved</p>
</div>
<div className="footer-right">
<p className="footer-info">사업자 등록번호 : 620-87-00810 | 대표 : 안성민</p>
<p className="footer-info">본사 : 41593 대구광역시 북구 옥산로 111, 5층 유니콘랩 대구 A05호</p>
<p className="footer-info">연구소 : 13453 경기 성남시 수정구 금토로 32 (금토동) (주)KT 판교빌딩 504호~505호 (East)</p>
<p className="footer-info">전화 : 070-4260-8310 | 010-2755-6463</p>
<p className="footer-info">이메일 : o2oteam@o2o.kr</p>
<p className="footer-info">{t('footer.businessNumber')}</p>
<p className="footer-info">{t('footer.headquarters')}</p>
<p className="footer-info">{t('footer.researchCenter')}</p>
<p className="footer-info">{t('footer.phone')}</p>
<p className="footer-info">{t('footer.email')}</p>
</div>
</div>
</footer>
+23 -18
View File
@@ -1,12 +1,15 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { getKakaoLoginUrl, isLoggedIn } from '../utils/api';
import LanguageSwitch from './LanguageSwitch';
interface HeaderProps {
onStartClick?: () => void;
}
const Header: React.FC<HeaderProps> = ({ onStartClick }) => {
const { t } = useTranslation();
const [isLoading, setIsLoading] = useState(false);
const loggedIn = isLoggedIn();
@@ -16,11 +19,10 @@ const Header: React.FC<HeaderProps> = ({ onStartClick }) => {
setIsLoading(true);
try {
const response = await getKakaoLoginUrl();
// 카카오 로그인 페이지로 리다이렉트
window.location.href = response.auth_url;
} catch (err) {
console.error('Failed to get Kakao login URL:', err);
alert('로그인 URL을 가져오는데 실패했습니다. 다시 시도해주세요.');
alert(t('header.loginFailedAlert'));
setIsLoading(false);
}
};
@@ -36,22 +38,25 @@ const Header: React.FC<HeaderProps> = ({ onStartClick }) => {
<div className="header-logo">
<img src="/assets/images/ado2-header-logo.svg" alt="ADO2" />
</div>
{loggedIn ? (
<button
className="header-start-btn"
onClick={handleStart}
>
시작하기
</button>
) : (
<button
className="header-login-btn"
onClick={handleLogin}
disabled={isLoading}
>
{isLoading ? '로딩...' : '로그인'}
</button>
)}
<div className="header-actions">
<LanguageSwitch />
{loggedIn ? (
<button
className="header-start-btn"
onClick={handleStart}
>
{t('header.start')}
</button>
) : (
<button
className="header-login-btn"
onClick={handleLogin}
disabled={isLoading}
>
{isLoading ? t('header.loading') : t('header.login')}
</button>
)}
</div>
</header>
);
};
+50
View File
@@ -0,0 +1,50 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
interface LanguageSwitchProps {
isCollapsed?: boolean;
}
const LanguageSwitch: React.FC<LanguageSwitchProps> = ({ isCollapsed = false }) => {
const { i18n } = useTranslation();
const isEnglish = i18n.language === 'en';
const switchTo = (lang: string) => {
if (i18n.language !== lang) {
i18n.changeLanguage(lang);
}
};
if (isCollapsed) {
return (
<button
className="lang-toggle-collapsed"
onClick={() => switchTo(isEnglish ? 'ko' : 'en')}
title={isEnglish ? '한국어로 전환' : 'Switch to English'}
>
{isEnglish ? 'EN' : 'KO'}
</button>
);
}
return (
<div className="lang-toggle">
<button
className={`lang-toggle-option ${!isEnglish ? 'active' : ''}`}
onClick={() => switchTo('ko')}
>
KO
</button>
<button
className={`lang-toggle-option ${isEnglish ? 'active' : ''}`}
onClick={() => switchTo('en')}
>
EN
</button>
<div className={`lang-toggle-slider ${isEnglish ? 'right' : 'left'}`} />
</div>
);
};
export default LanguageSwitch;
+14 -7
View File
@@ -1,7 +1,9 @@
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { UserMeResponse } from '../types/api';
import { logout } from '../utils/api';
import LanguageSwitch from './LanguageSwitch';
interface SidebarItemProps {
icon: React.ReactNode;
@@ -36,6 +38,7 @@ interface SidebarProps {
}
const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userInfo, onLogout }) => {
const { t } = useTranslation();
const [isCollapsed, setIsCollapsed] = useState(false);
const [isMobileOpen, setIsMobileOpen] = useState(false);
const [isLoggingOut, setIsLoggingOut] = useState(false);
@@ -76,11 +79,11 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
};
const menuItems = [
{ id: '대시보드', label: '대시보드', disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/></svg> },
{ id: '새 프로젝트 만들기', label: '새 프로젝트 만들기', disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> },
{ id: 'ADO2 콘텐츠', label: 'ADO2 콘텐츠', disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> },
{ id: '내 콘텐츠', label: '내 콘텐츠', disabled: true, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
{ id: '내 정보', label: '내 정보', disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> },
{ id: '대시보드', label: t('sidebar.dashboard'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="7" height="9"/><rect x="14" y="3" width="7" height="5"/><rect x="14" y="12" width="7" height="9"/><rect x="3" y="16" width="7" height="5"/></svg> },
{ id: '새 프로젝트 만들기', label: t('sidebar.newProject'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg> },
{ id: 'ADO2 콘텐츠', label: t('sidebar.ado2Contents'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg> },
{ id: '내 콘텐츠', label: t('sidebar.myContents'), disabled: true, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg> },
{ id: '내 정보', label: t('sidebar.myInfo'), disabled: false, icon: <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg> },
];
return (
@@ -145,6 +148,10 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
</div>
<div className="sidebar-footer">
<div className="sidebar-language-switch">
<LanguageSwitch isCollapsed={isCollapsed} />
</div>
<div className={`profile-section ${isCollapsed ? 'collapsed' : ''}`}>
{userInfo?.profile_image_url || userInfo?.thumbnail_image_url ? (
<img
@@ -162,7 +169,7 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
)}
{!isCollapsed && (
<div className="flex-1 min-w-0">
<p className="profile-name">{userInfo?.nickname || '사용자'}</p>
<p className="profile-name">{userInfo?.nickname || t('sidebar.defaultUser')}</p>
</div>
)}
</div>
@@ -175,7 +182,7 @@ const Sidebar: React.FC<SidebarProps> = ({ activeItem, onNavigate, onHome, userI
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/><polyline points="16 17 21 12 16 7"/><line x1="21" y1="12" x2="9" y2="12"/>
</svg>
{!isCollapsed && <span className="logout-btn-label">{isLoggingOut ? '로그아웃 중...' : '로그아웃'}</span>}
{!isCollapsed && <span className="logout-btn-label">{isLoggingOut ? t('sidebar.loggingOut') : t('sidebar.logout')}</span>}
</button>
</div>
</div>
+32 -30
View File
@@ -1,5 +1,6 @@
import React, { useState, useEffect, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import { getSocialAccounts, uploadToSocial, waitForUploadComplete, TokenExpiredError, handleSocialReconnect } from '../utils/api';
import { SocialAccount, VideoListItem, SocialUploadStatusResponse } from '../types/api';
import UploadProgressModal, { UploadStatus } from './UploadProgressModal';
@@ -30,6 +31,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
onClose,
video
}) => {
const { t } = useTranslation();
const [socialAccounts, setSocialAccounts] = useState<SocialAccount[]>([]);
const [selectedChannel, setSelectedChannel] = useState<string>('');
const [title, setTitle] = useState('');
@@ -93,7 +95,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
}
} catch (error) {
if (error instanceof TokenExpiredError) {
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
alert(t('social.youtubeExpiredAlert'));
handleSocialReconnect(error.reconnectUrl);
return;
}
@@ -105,20 +107,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
const handlePost = async () => {
if (!selectedChannel || !title.trim() || !video) {
alert('채널과 제목을 입력해주세요.');
alert(t('social.channelAndTitleRequired'));
return;
}
const selectedAcc = socialAccounts.find(acc => acc.platform_user_id === selectedChannel);
if (!selectedAcc) {
alert('채널을 선택해주세요.');
alert(t('social.selectChannel'));
return;
}
// video.video_id 검증 - 반드시 존재해야 함
if (!video.video_id) {
console.error('Video object missing video_id:', video);
alert('영상 정보가 올바르지 않습니다. (video_id 누락)');
alert(t('social.invalidVideoInfo'));
return;
}
@@ -157,7 +159,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
const uploadResponse = await uploadToSocial(requestPayload);
if (!uploadResponse.success) {
throw new Error(uploadResponse.message || '업로드 시작에 실패했습니다.');
throw new Error(uploadResponse.message || t('social.uploadStartFailed'));
}
// Poll for upload completion
@@ -180,13 +182,13 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
} catch (error) {
if (error instanceof TokenExpiredError) {
setShowUploadProgress(false);
alert('YouTube 인증이 만료되었습니다. 재연동 페이지로 이동합니다.');
alert(t('social.youtubeExpiredAlert'));
handleSocialReconnect(error.reconnectUrl);
return;
}
console.error('Upload failed:', error);
setUploadStatus('failed');
setUploadErrorMessage(error instanceof Error ? error.message : '업로드에 실패했습니다.');
setUploadErrorMessage(error instanceof Error ? error.message : t('social.uploadFailed'));
} finally {
setIsPosting(false);
}
@@ -221,9 +223,9 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
const selectedAccount = socialAccounts.find(acc => acc.platform_user_id === selectedChannel);
const privacyOptions = [
{ value: 'public', label: '공개' },
{ value: 'unlisted', label: '미등록 (링크로만 접근)' },
{ value: 'private', label: '비공개' }
{ value: 'public', label: t('social.privacyPublic') },
{ value: 'unlisted', label: t('social.privacyUnlisted') },
{ value: 'private', label: t('social.privacyPrivate') }
];
const selectedPrivacyOption = privacyOptions.find(opt => opt.value === privacy);
@@ -253,7 +255,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
<div className="social-posting-modal" onClick={(e) => e.stopPropagation()}>
{/* Header */}
<div className="social-posting-header">
<h2 className="social-posting-title">소셜 미디어 포스팅</h2>
<h2 className="social-posting-title">{t('social.title')}</h2>
<button className="social-posting-close" onClick={handleClose}>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<line x1="18" y1="6" x2="6" y2="18"/>
@@ -280,7 +282,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
<div className="social-posting-form">
{/* Video Info */}
<div className="social-posting-video-info">
<span className="social-posting-label-badge">게시물 1</span>
<span className="social-posting-label-badge">{t('social.postNumber')}</span>
<span className="social-posting-add-btn">+</span>
</div>
@@ -288,20 +290,20 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
<p className="social-posting-video-title">
{video.store_name} {new Date(video.created_at).toLocaleString('ko-KR')}
</p>
<p className="social-posting-video-specs">1080x1920 · 10초</p>
<p className="social-posting-video-specs">{t('social.videoSpecs')}</p>
</div>
{/* Channel Selector - Custom Dropdown */}
<div className="social-posting-field">
<label className="social-posting-label">
게시 채널 <span className="required">*</span>
{t('social.channelLabel')} <span className="required">*</span>
</label>
{isLoadingAccounts ? (
<div className="social-posting-loading">계정 로딩 중...</div>
<div className="social-posting-loading">{t('social.loadingAccounts')}</div>
) : socialAccounts.length === 0 ? (
<div className="social-posting-no-accounts">
<p>연결된 소셜 계정이 없습니다.</p>
<p className="social-posting-no-accounts-hint">내 정보에서 계정을 연결해주세요.</p>
<p>{t('social.noAccounts')}</p>
<p className="social-posting-no-accounts-hint">{t('social.noAccountsHint')}</p>
</div>
) : (
<div className="social-posting-channel-dropdown" ref={channelDropdownRef}>
@@ -355,13 +357,13 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
{/* Title */}
<div className="social-posting-field">
<label className="social-posting-label">
게시물 제목 <span className="required">*</span>
{t('social.postTitleLabel')} <span className="required">*</span>
</label>
<input
type="text"
value={title}
onChange={(e) => setTitle(e.target.value)}
placeholder="게시물 제목을 입력하세요."
placeholder={t('social.postTitlePlaceholder')}
className="social-posting-input"
maxLength={100}
/>
@@ -370,11 +372,11 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
{/* Description */}
<div className="social-posting-field">
<label className="social-posting-label">게시물 내용</label>
<label className="social-posting-label">{t('social.postContentLabel')}</label>
<textarea
value={description}
onChange={(e) => setDescription(e.target.value)}
placeholder="게시물 내용을 입력하세요."
placeholder={t('social.postContentPlaceholder')}
className="social-posting-textarea"
maxLength={5000}
rows={4}
@@ -384,12 +386,12 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
{/* Tags */}
<div className="social-posting-field">
<label className="social-posting-label">태그</label>
<label className="social-posting-label">{t('social.tagsLabel')}</label>
<input
type="text"
value={tags}
onChange={(e) => setTags(e.target.value)}
placeholder="태그를 입력하세요. (쉼표로 구분)"
placeholder={t('social.tagsPlaceholder')}
className="social-posting-input"
maxLength={500}
/>
@@ -399,7 +401,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
{/* Privacy - Custom Dropdown */}
<div className="social-posting-field">
<label className="social-posting-label">
게시물 공개 범위 <span className="required">*</span>
{t('social.privacyLabel')} <span className="required">*</span>
</label>
<div className="social-posting-channel-dropdown" ref={privacyDropdownRef}>
<button
@@ -437,7 +439,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
{/* Publish Time */}
<div className="social-posting-field">
<label className="social-posting-label">
게시 시간 <span className="required">*</span>
{t('social.publishTimeLabel')} <span className="required">*</span>
</label>
<div className="social-posting-radio-group">
<label className="social-posting-radio">
@@ -448,7 +450,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
checked={publishTime === 'now'}
onChange={() => setPublishTime('now')}
/>
<span className="radio-label">지금 게시</span>
<span className="radio-label">{t('social.publishNow')}</span>
</label>
<label className="social-posting-radio">
<input
@@ -459,7 +461,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
onChange={() => setPublishTime('schedule')}
disabled
/>
<span className="radio-label disabled">시간 설정 (준비 중)</span>
<span className="radio-label disabled">{t('social.publishSchedule')}</span>
</label>
</div>
</div>
@@ -469,7 +471,7 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
{/* Footer */}
<div className="social-posting-footer">
<p className="social-posting-footer-note">
게시는 <a href="#" className="social-posting-link">요금제 업그레이드</a> 후 가능합니다.
{t('social.footerNote', { link: '' })}<a href="#" className="social-posting-link">{t('social.footerNoteLink')}</a>
</p>
<div className="social-posting-actions">
<button
@@ -477,14 +479,14 @@ const SocialPostingModal: React.FC<SocialPostingModalProps> = ({
onClick={handleClose}
disabled={isPosting}
>
취소
{t('social.cancel')}
</button>
<button
className="social-posting-btn submit"
onClick={handlePost}
disabled={isPosting || socialAccounts.length === 0 || !title.trim()}
>
{isPosting ? '게시 중...' : '게시'}
{isPosting ? t('social.posting') : t('social.post')}
</button>
</div>
</div>
+13 -11
View File
@@ -1,5 +1,6 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
export type UploadStatus = 'pending' | 'uploading' | 'completed' | 'failed';
@@ -24,20 +25,21 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
youtubeUrl,
errorMessage,
}) => {
const { t } = useTranslation();
if (!isOpen) return null;
const getStatusText = () => {
switch (status) {
case 'pending':
return '업로드 준비 중...';
return t('upload.statusPending');
case 'uploading':
return '업로드 중...';
return t('upload.statusUploading');
case 'completed':
return '업로드 완료!';
return t('upload.statusCompleted');
case 'failed':
return '업로드 실패';
return t('upload.statusFailed');
default:
return '처리 중...';
return t('upload.statusDefault');
}
};
@@ -81,7 +83,7 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
<div className="upload-progress-modal">
{/* Header */}
<div className="upload-progress-header">
<h2 className="upload-progress-title">YouTube 업로드</h2>
<h2 className="upload-progress-title">{t('upload.title')}</h2>
{canClose && (
<button className="upload-progress-close" onClick={onClose}>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
@@ -114,11 +116,11 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
{/* Video Info */}
<div className="upload-progress-info">
<div className="upload-progress-info-row">
<span className="upload-progress-label">영상 제목</span>
<span className="upload-progress-label">{t('upload.videoTitleLabel')}</span>
<span className="upload-progress-value">{videoTitle}</span>
</div>
<div className="upload-progress-info-row">
<span className="upload-progress-label">채널</span>
<span className="upload-progress-label">{t('upload.channelLabel')}</span>
<span className="upload-progress-value">{channelName}</span>
</div>
</div>
@@ -139,7 +141,7 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
className="upload-progress-youtube-link"
>
<img src="/assets/images/social-youtube.png" alt="YouTube" className="upload-youtube-icon" />
YouTube에서 보기
{t('upload.viewOnYoutube')}
</a>
)}
</div>
@@ -148,10 +150,10 @@ const UploadProgressModal: React.FC<UploadProgressModalProps> = ({
<div className="upload-progress-footer">
{canClose ? (
<button className="upload-progress-btn primary" onClick={onClose}>
{status === 'completed' ? '확인' : '닫기'}
{status === 'completed' ? t('upload.confirm') : t('upload.close')}
</button>
) : (
<p className="upload-progress-note">업로드가 진행 중입니다. 창을 닫지 마세요.</p>
<p className="upload-progress-note">{t('upload.doNotClose')}</p>
)}
</div>
</div>