diff --git a/src/components/CollectiveMembers.tsx b/src/components/CollectiveMembers.tsx index df5651a..7becfad 100644 --- a/src/components/CollectiveMembers.tsx +++ b/src/components/CollectiveMembers.tsx @@ -16,6 +16,7 @@ import { useCurrentUser } from '@/hooks/useCurrentUser'; import { genUserName } from '@/lib/genUserName'; import { useCollectiveMembers, type CollectiveMember } from '@/hooks/useCollectiveMembers'; import { CREW_ROLE_META, type CrewRole } from '@/lib/types'; +import { CREW_ROLE_KEYS } from '@/lib/labelKeys'; import { cn } from '@/lib/utils'; interface CollectiveMembersProps { @@ -33,10 +34,11 @@ interface CollectiveMembersProps { /** Skate-role flex chip (🎥 Filmer, 📷 Photographer, …). */ function RoleChip({ role }: { role: CrewRole }) { + const { t } = useTranslation(); const meta = CREW_ROLE_META[role]; return ( - {meta.emoji} {meta.label} + {meta.emoji} {CREW_ROLE_KEYS[role] ? t(CREW_ROLE_KEYS[role]) : meta.label} ); } diff --git a/src/components/ConfirmMembershipCard.tsx b/src/components/ConfirmMembershipCard.tsx index b0705a9..976f4f4 100644 --- a/src/components/ConfirmMembershipCard.tsx +++ b/src/components/ConfirmMembershipCard.tsx @@ -12,6 +12,7 @@ import { MEMBER_VISIBILITY_DESCRIPTIONS, type MemberVisibility, } from '@/lib/types'; +import { MEMBER_VISIBILITY_DESC_KEYS } from '@/lib/labelKeys'; interface ConfirmMembershipCardProps { kind: number; @@ -61,7 +62,9 @@ export function VisibilityPicker({ })}
- {MEMBER_VISIBILITY_DESCRIPTIONS[value]} + {MEMBER_VISIBILITY_DESC_KEYS[value] + ? t(MEMBER_VISIBILITY_DESC_KEYS[value]) + : MEMBER_VISIBILITY_DESCRIPTIONS[value]}
); diff --git a/src/components/CrewForm.tsx b/src/components/CrewForm.tsx index 0b902ad..2a2fb65 100644 --- a/src/components/CrewForm.tsx +++ b/src/components/CrewForm.tsx @@ -22,6 +22,7 @@ import { isCrewVideoUrl, parseCrewVideo } from '@/lib/videoEmbed'; import { CrewSponsorPicker } from '@/components/crew/CrewSponsorPicker'; import { NofferField } from '@/components/NofferField'; import { SKATE_CREW_KIND, SKATE_SPOT_KIND, SKATE_SHOP_KIND, parseAddrCoord, ZAP_GOAL_KIND, CREW_VIBE_LABELS, CREW_FOCUS_LABELS, CREW_FOCUS_DESCRIPTIONS, CREW_FOCUS_TAG, CREW_LOOKING_FOR_OPTIONS, CREW_ROLE_META, CREW_ROLE_ORDER, SHOW_CREW_TREASURY, isValidNoffer, type SkateCrew, type CrewFocus, type CrewRole } from '@/lib/types'; +import { CREW_VIBE_KEYS, CREW_FOCUS_KEYS, CREW_FOCUS_DESC_KEYS, CREW_LOOKING_FOR_KEYS, CREW_ROLE_KEYS } from '@/lib/labelKeys'; import { useCrewGoal } from '@/hooks/useCrewGoal'; import { useCoordinator } from '@/hooks/useCoordinator'; import { coordinatorAddUrl, crewCoordinatorInputValue, parseCrewCoordinatorInput, shortNpub } from '@/lib/coordinator'; @@ -40,7 +41,7 @@ const FOCUS_ICONS: Record{meta.label}
-{meta.description}
+{t(meta.labelKey)}
+{t(meta.descriptionKey)}
{nav.stepIndex >= 0 - ? route?.steps?.[nav.stepIndex]?.instruction ?? t('routeUi.followTheLine') - : route?.steps?.[0]?.instruction ?? t('routeUi.followTheLine')} + ? route?.steps?.[nav.stepIndex] ? stepInstruction(route.steps[nav.stepIndex], t) : t('routeUi.followTheLine') + : route?.steps?.[0] ? stepInstruction(route.steps[0], t) : t('routeUi.followTheLine')}
{nav.stepIndex >= 0 && Number.isFinite(nav.stepKm)
@@ -1073,7 +1111,7 @@ export function RouteDialog({
: t('routeUi.direct')}
{mode === 'foot'
- ? · {skateTime(route.distanceM / 1000)} {t('routeUi.onABoard')}
+ ? · {skateTime(route.distanceM / 1000, t)}
: speed && (
· {t('routeUi.speedAvg', { speed })}
)}
@@ -1127,7 +1165,7 @@ export function RouteDialog({
{i + 1}
- {s.instruction}
+ {stepInstruction(s, t)}
{s.distanceM >= 10 && (
{formatDistance(s.distanceM / 1000)}
diff --git a/src/components/SasquatchActionCard.tsx b/src/components/SasquatchActionCard.tsx
index 89fbe25..64ae716 100644
--- a/src/components/SasquatchActionCard.tsx
+++ b/src/components/SasquatchActionCard.tsx
@@ -27,7 +27,7 @@ interface Props {
export function SasquatchActionCard({ draft, onPublish, onCancel, status, resultLabel }: Props) {
const { t } = useTranslation();
const [edited, setEdited] = useState
{t('sasquatchUi.scanToPayPre')}{' '}
{t('sasquatchUi.scanToPayAmount', { sats: selected.sats.toLocaleString() })}{' '}
- {t('sasquatchUi.scanToPayPost', { label: selected.label })}
+ {t('sasquatchUi.scanToPayPost', { label: t(selected.labelKey) })}
{tier.label} {t(tier.labelKey)} {tier.sats.toLocaleString()}{t('sasquatchUi.sats')} {[usd, tier.badge].filter(Boolean).join(' · ')} {[usd, tier.badgeKey ? t(tier.badgeKey) : tier.badge].filter(Boolean).join(' · ')} {meta.label} {meta.description} {t(meta.labelKey)} {t(meta.descriptionKey)}
{reporterCount} {reporterCount === 1 ? t('spotUi.reportOne') : t('spotUi.reports')}
{lastAt ? ` · ${t('spotUi.lastReported', { time: statusTimeAgo(lastAt) })}` : ''}
diff --git a/src/components/TourCard.tsx b/src/components/TourCard.tsx
index 544c882..15a5eb2 100644
--- a/src/components/TourCard.tsx
+++ b/src/components/TourCard.tsx
@@ -18,6 +18,7 @@ import { ReportDialog } from '@/components/ReportDialog';
import type { SkateTour, TourCategory } from '@/lib/types';
import { TOUR_CATEGORIES, TOUR_SKILL_LEVELS } from '@/lib/types';
+import { TOUR_CATEGORY_KEYS } from '@/lib/labelKeys';
import { cn } from '@/lib/utils';
import { useTranslation } from '@/contexts/language';
@@ -229,7 +230,7 @@ export function TourCard({ tour, compact = false }: TourCardProps) {
className="text-[10px] px-1.5 py-0 font-bold"
style={{ borderColor: categoryInfo.color, color: categoryInfo.color }}
>
- {categoryInfo.label}
+ {TOUR_CATEGORY_KEYS[tour.category] ? t(TOUR_CATEGORY_KEYS[tour.category]) : categoryInfo.label}
{tour.duration && (
@@ -299,7 +300,7 @@ export function TourCard({ tour, compact = false }: TourCardProps) {
color: (categoryInfo.color as string) === '#ccff00' ? 'black' : 'white'
}}
>
- {categoryInfo.emoji} {categoryInfo.label}
+ {categoryInfo.emoji} {TOUR_CATEGORY_KEYS[tour.category] ? t(TOUR_CATEGORY_KEYS[tour.category]) : categoryInfo.label}
}