diff --git a/frontend/src/i18n.ts b/frontend/src/i18n.ts index 03d9f1f..74ce1f8 100644 --- a/frontend/src/i18n.ts +++ b/frontend/src/i18n.ts @@ -94,7 +94,27 @@ const resources = { "buyNow": "Buy Now", "reviews": "reviews", "rank": "Rank", - "loading": "Loading..." + "loading": "Loading...", + "replies": "Replies", + "reply": "Reply", + "edit": "Edit", + "delete": "Delete", + "save": "Save", + "cancel": "Cancel" + }, + "community": { + "title": "Community Activity", + "subtitle": "Stay updated with your circle's latest ratings and discussions.", + "quietFeed": "Your feed is a bit empty...", + "followMore": "Follow more people to see their flavor ratings here!", + "topRated": "Circle's Top Rated", + "notifications": "Recent Notifications", + "notifReply": "replied", + "notifMention": "mentioned you", + "noNotifications": "No notifications.", + "searchFriends": "Search friends...", + "writeReply": "Add a reply...", + "rated": "rated" }, "about": { "title": "About This Project", @@ -204,7 +224,27 @@ const resources = { "buyNow": "Jetzt kaufen", "reviews": "Bewertungen", "rank": "Rang", - "loading": "Wird geladen..." + "loading": "Wird geladen...", + "replies": "Antworten", + "reply": "Antworten", + "edit": "Bearbeiten", + "delete": "Löschen", + "save": "Speichern", + "cancel": "Abbrechen" + }, + "community": { + "title": "Community-Aktivität", + "subtitle": "Bleib auf dem Laufenden mit den neuesten Bewertungen und Diskussionen deines Kreises.", + "quietFeed": "Dein Feed ist noch etwas leer...", + "followMore": "Folge mehr Personen, um deren Bewertungen hier zu sehen!", + "topRated": "Top-Bewertungen deines Kreises", + "notifications": "Neueste Benachrichtigungen", + "notifReply": "hat geantwortet", + "notifMention": "hat dich erwähnt", + "noNotifications": "Keine Benachrichtigungen.", + "searchFriends": "Freunde suchen...", + "writeReply": "Eine Antwort hinzufügen...", + "rated": "bewertete" }, "about": { "title": "Über dieses Projekt", diff --git a/frontend/src/pages/CommunityFeed.tsx b/frontend/src/pages/CommunityFeed.tsx index 2a001ee..7f5f5e6 100644 --- a/frontend/src/pages/CommunityFeed.tsx +++ b/frontend/src/pages/CommunityFeed.tsx @@ -32,6 +32,7 @@ import api from '../api'; import { useTitle } from '../hooks/useTitle'; import RichText from '../components/RichText'; import { formatDate } from '../utils/date'; +import { useTranslation } from 'react-i18next'; interface Reply { id: number; @@ -76,7 +77,8 @@ interface Notification { } const CommunityFeed: React.FC = () => { - useTitle('Community Feed'); + const { t } = useTranslation(); + useTitle(t('community.title')); const navigate = useNavigate(); const [ratings, setRatings] = useState([]); const [following, setFollowing] = useState([]); @@ -175,9 +177,9 @@ const CommunityFeed: React.FC = () => { return ( - Community Activity + {t('community.title')} - Stay updated with your circle's latest ratings and discussions. + {t('community.subtitle')} @@ -194,12 +196,12 @@ const CommunityFeed: React.FC = () => { border: '1px dashed', borderColor: 'divider' }}> - Your feed is a bit empty... + {t('community.quietFeed')} - Follow more people to see their flavor ratings here! + {t('community.followMore')} ) : ( @@ -254,14 +256,14 @@ const CommunityFeed: React.FC = () => { - Rated {rating.flavor_name} + {t('community.rated')} {rating.flavor_name} {rating.comment ? ( ) : ( - No review text. + {t('dashboard.noRatings')} )} @@ -280,7 +282,7 @@ const CommunityFeed: React.FC = () => { onClick={() => handleReplyToggle(rating.id)} sx={{ textTransform: 'none', color: 'text.secondary' }} > - {rating.replies.length > 0 ? `${rating.replies.length} Replies` : 'Reply'} + {rating.replies.length > 0 ? `${rating.replies.length} ${t('common.replies')}` : t('common.reply')} @@ -296,7 +298,7 @@ const CommunityFeed: React.FC = () => { ))} setReplyInputs(prev => ({ ...prev, [rating.id]: e.target.value }))} onKeyDown={(e) => e.key === 'Enter' && handleReplySubmit(rating.id)} @@ -327,11 +329,11 @@ const CommunityFeed: React.FC = () => { - Recent Notifications + {t('community.notifications')} {notifications.length === 0 ? ( - No notifications. + {t('community.noNotifications')} ) : ( notifications.map(n => ( n.flavor_id && navigate(`/flavor/${n.flavor_id}`)} sx={{ py: 1.5 }}> @@ -341,7 +343,7 @@ const CommunityFeed: React.FC = () => { - {n.actor_username} {n.notification_type === 'reply' ? 'replied' : 'mentioned you'} + {n.actor_username} {n.notification_type === 'reply' ? t('community.notifReply') : t('community.notifMention')} } secondary={formatTimestamp(n.created_at)} @@ -357,11 +359,11 @@ const CommunityFeed: React.FC = () => { - Following + {t('nav.following')} setFollowingSearch(e.target.value)} InputProps={{ startAdornment: }} @@ -381,7 +383,7 @@ const CommunityFeed: React.FC = () => { - Circle's Top Rated + {t('community.topRated')} {topFollowed.map((flavor, idx) => ( diff --git a/frontend/src/pages/MainPage.tsx b/frontend/src/pages/MainPage.tsx index 66b19a8..6e320c0 100644 --- a/frontend/src/pages/MainPage.tsx +++ b/frontend/src/pages/MainPage.tsx @@ -251,56 +251,63 @@ const MainPage: React.FC = () => { ) : ( - + {feedRatings.map(rating => ( alpha(theme.palette.background.paper, 0.4), backdropFilter: 'blur(10px)', border: '1px solid', - borderColor: (theme) => alpha(theme.palette.text.primary, 0.05) + borderColor: 'divider', + color: 'inherit', + display: 'flex', + flexDirection: 'column' }} > - - - - + + + + {!rating.user_avatar && rating.user.charAt(0).toUpperCase()} - {rating.user} - - rated - - - {formatDate(rating.created_at)} + + {rating.user} + + + + {t('home.rated')} {formatDate(rating.created_at)} - + + - - - {rating.flavor_name} + + {rating.flavor_name} + + + alpha(theme.palette.primary.main, 0.1), + px: 1, + py: 0.2, + borderRadius: 1, + fontSize: '0.75rem' + }}> + {rating.score} / 10 - - - {/* Compact rating for anything below Large desktop to prevent cutoffs */} - - - {rating.score}/10 - - - - {rating.score}/10 - diff --git a/frontend/src/pages/flavors/FlavorDetail.tsx b/frontend/src/pages/flavors/FlavorDetail.tsx index 93cb0dd..de7f9c2 100644 --- a/frontend/src/pages/flavors/FlavorDetail.tsx +++ b/frontend/src/pages/flavors/FlavorDetail.tsx @@ -388,8 +388,8 @@ const FlavorDetail: React.FC = () => { onChange={(e) => setEditComment(e.target.value)} /> - - + + ) : ( @@ -437,8 +437,8 @@ const FlavorDetail: React.FC = () => { {currentUser === rating.user && ( - - + + )} @@ -471,8 +471,8 @@ const FlavorDetail: React.FC = () => { {currentUser === reply.user && editingReplyId !== reply.id && ( - - + + )} @@ -487,8 +487,8 @@ const FlavorDetail: React.FC = () => { onChange={(e) => setEditReplyText(e.target.value)} /> - - + + ) : ( @@ -505,13 +505,13 @@ const FlavorDetail: React.FC = () => { setReplyInputs({ ...replyInputs, [rating.id]: e.target.value })} sx={{ '& .MuiOutlinedInput-root': { bgcolor: 'background.paper' } }} /> - + )}