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

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

+10 -8
View File
@@ -1,5 +1,6 @@
import React, { useRef, useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import Header from './components/Header';
import HeroSection from './pages/Landing/HeroSection';
import WelcomeSection from './pages/Landing/WelcomeSection';
@@ -43,6 +44,7 @@ const initializeOnNewSession = () => {
initializeOnNewSession();
const App: React.FC = () => {
const { t } = useTranslation();
const containerRef = useRef<HTMLElement>(null);
// localStorage에서 저장된 상태 복원 (새 세션이면 이미 초기화됨)
@@ -148,7 +150,7 @@ const App: React.FC = () => {
}
} catch (err) {
console.error('Token callback failed:', err);
alert('로그인 처리에 실패했습니다. 다시 시도해주세요.');
alert(t('app.loginFailed'));
} finally {
setIsProcessingCallback(false);
}
@@ -162,7 +164,7 @@ const App: React.FC = () => {
window.location.href = response.redirect_url;
} catch (err) {
console.error('Kakao callback failed:', err);
alert('카카오 로그인에 실패했습니다. 다시 시도해주세요.');
alert(t('app.kakaoLoginFailed'));
// URL에서 code 파라미터 제거
const url = new URL(window.location.href);
@@ -265,7 +267,7 @@ const App: React.FC = () => {
// 응답 유효성 검사
if (!validateCrawlingResponse(data)) {
throw new Error('유효하지 않은 URL입니다. 네이버 지도 URL을 입력해주세요.');
throw new Error(t('app.invalidUrl'));
}
setAnalysisData(data);
@@ -273,7 +275,7 @@ const App: React.FC = () => {
setViewMode('analysis');
} catch (err) {
console.error('Crawling failed:', err);
const errorMessage = err instanceof Error ? err.message : '분석 중 오류가 발생했습니다. 다시 시도해주세요.';
const errorMessage = err instanceof Error ? err.message : t('app.analysisError');
setError(errorMessage);
setViewMode('landing');
}
@@ -289,7 +291,7 @@ const App: React.FC = () => {
// 응답 유효성 검사
if (!validateCrawlingResponse(data)) {
throw new Error('업체 정보를 가져오는데 실패했습니다. 다시 시도해주세요.');
throw new Error(t('app.autocompleteError'));
}
setAnalysisData(data);
@@ -297,7 +299,7 @@ const App: React.FC = () => {
setViewMode('analysis');
} catch (err) {
console.error('Autocomplete failed:', err);
const errorMessage = err instanceof Error ? err.message : '업체 정보 조회 중 오류가 발생했습니다. 다시 시도해주세요.';
const errorMessage = err instanceof Error ? err.message : t('app.autocompleteGeneralError');
setError(errorMessage);
setViewMode('landing');
}
@@ -325,7 +327,7 @@ const App: React.FC = () => {
window.location.href = response.auth_url;
} catch (err) {
console.error('Failed to get Kakao login URL:', err);
alert('로그인 URL을 가져오는데 실패했습니다. 다시 시도해주세요.');
alert(t('app.loginUrlFailed'));
}
};
@@ -364,7 +366,7 @@ const App: React.FC = () => {
return (
<div className="login-container" style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<div style={{ textAlign: 'center', color: '#fff' }}>
<p style={{ fontSize: '18px' }}>로그인 처리 중...</p>
<p style={{ fontSize: '18px' }}>{t('app.loginProcessing')}</p>
</div>
</div>
);