Feature: Russian language support & Vehicle Requests improvements
- Add Russian language support (title_ru, subtitle_ru) for hero banners - Add fuel/transmission translations for Mongolian (경유→Дизель, 오토→Автомат) - Improve Vehicle Requests admin page: - Display real request ID and user email - Show detailed request info (maker, grade, year, fuel, mileage) - Replace modal search with Cars page integration - Add "Add to Request" flow in Cars page for vehicle recommendations - Fix image URL handling in FilmStripSlider and car detail page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -338,15 +338,23 @@ const getImageUrl = (url: string): string => {
|
||||
|
||||
// Helper to get localized title/subtitle based on language
|
||||
function getLocalizedText(banner: HeroBanner, field: 'title' | 'subtitle', language: Language): string {
|
||||
// Public API returns localized single field (title, subtitle)
|
||||
const directField = banner[field as keyof HeroBanner] as string | undefined;
|
||||
if (directField) {
|
||||
return directField;
|
||||
}
|
||||
// Admin API returns multi-language fields (title_ko, title_en, etc.)
|
||||
// 1. 먼저 선택된 언어의 필드 확인 (title_mn, title_en, etc.)
|
||||
const langKey = `${field}_${language}` as keyof HeroBanner;
|
||||
const langValue = banner[langKey] as string | undefined;
|
||||
if (langValue) {
|
||||
return langValue;
|
||||
}
|
||||
|
||||
// 2. 영어 폴백
|
||||
const enKey = `${field}_en` as keyof HeroBanner;
|
||||
return (banner[langKey] as string) || (banner[enKey] as string) || '';
|
||||
const enValue = banner[enKey] as string | undefined;
|
||||
if (enValue) {
|
||||
return enValue;
|
||||
}
|
||||
|
||||
// 3. 마지막으로 직접 필드 (API가 단일 필드로 반환하는 경우)
|
||||
const directField = banner[field as keyof HeroBanner] as string | undefined;
|
||||
return directField || '';
|
||||
}
|
||||
|
||||
function BannerCard({ banner, width, height }: BannerCardProps) {
|
||||
|
||||
Reference in New Issue
Block a user