diff --git a/locales/rn/en.json b/locales/rn/en.json index 439b081f..a569206a 100644 --- a/locales/rn/en.json +++ b/locales/rn/en.json @@ -417,6 +417,7 @@ "delete_item_title": "Delete this item?", "delete_items_title": "{count, plural, one {Delete # item?} other {Delete # items?}}", "done": "Done", + "download_failed_status": "Download failed (HTTP {status})", "folder_empty": "This folder is empty", "invalid_name": "Invalid name", "invalid_name_slash": "Names cannot contain \"/\".", diff --git a/src/components/__tests__/contacts-i18n.test.ts b/src/components/__tests__/contacts-i18n.test.ts index aa2818d7..833e27f6 100644 --- a/src/components/__tests__/contacts-i18n.test.ts +++ b/src/components/__tests__/contacts-i18n.test.ts @@ -25,6 +25,7 @@ const TRANSLATED_FILES: Record = { 'components/contacts/ContactPickerSheet.tsx': [], 'components/contacts/TagAssignSheet.tsx': [], 'components/contacts/ContactListRow.tsx': [], + 'components/contacts/FieldBlock.tsx': [], }; describe('translated contacts screens', () => { diff --git a/src/components/calendar/EventCard.tsx b/src/components/calendar/EventCard.tsx index a67606b3..ddc71ce0 100644 --- a/src/components/calendar/EventCard.tsx +++ b/src/components/calendar/EventCard.tsx @@ -80,7 +80,7 @@ export function EventCard({ event, calendars, timeFormat, onPress, onLongPress } - {count} {t('calendar.participants.title', 'Participants').toLowerCase()} + {t('calendar.participants.count', '{count, plural, one {# participant} other {# participants}}', { count })} )} diff --git a/src/components/calendar/EventDetailSheet.tsx b/src/components/calendar/EventDetailSheet.tsx index 7c43b1ed..0429e54e 100644 --- a/src/components/calendar/EventDetailSheet.tsx +++ b/src/components/calendar/EventDetailSheet.tsx @@ -340,7 +340,7 @@ export function EventDetailSheet({ - {participants.length} {t('calendar.participants.title', 'Participants').toLowerCase()} + {t('calendar.participants.count', '{count, plural, one {# participant} other {# participants}}', { count: participants.length })} {participants.map((p) => ( diff --git a/src/components/contacts/ContactActivity.tsx b/src/components/contacts/ContactActivity.tsx index 6a53dc77..b7caf5a9 100644 --- a/src/components/contacts/ContactActivity.tsx +++ b/src/components/contacts/ContactActivity.tsx @@ -3,7 +3,7 @@ import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-nati import { useNavigation } from '@react-navigation/native'; import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; import { Mail as MailIcon, CalendarDays } from 'lucide-react-native'; -import { format, isAfter, parseISO } from 'date-fns'; +import { format, isAfter, parseISO, type Locale } from 'date-fns'; import type { ContactCard, Email, CalendarEvent } from '../../api/types'; import type { RootStackParamList } from '../../navigation/types'; import { getEmails, queryEmailsByFilter } from '../../api/email'; @@ -11,6 +11,7 @@ import { getEvents, queryEvents } from '../../api/calendar'; import { useCalendarStore } from '../../stores/calendar-store'; import { useLocaleStore, type TranslateFn } from '../../stores/locale-store'; import { getEventColor } from '../../lib/calendar-utils'; +import { getDateFnsLocale } from '../../lib/calendar-locale'; import { hasCalendarCapability } from '../../lib/capabilities'; import { singleLine } from '../../lib/single-line'; import { prefetchMessage } from '../../lib/email-detail-cache'; @@ -64,13 +65,13 @@ function eventInvolvesContact(event: CalendarEvent, addresses: Set): boo return false; } -function formatRelativeDate(iso: string): string { +function formatRelativeDate(iso: string, locale: Locale): string { try { const d = parseISO(iso); const now = new Date(); return d.getFullYear() === now.getFullYear() - ? format(d, 'MMM d') - : format(d, 'MMM d, yyyy'); + ? format(d, 'MMM d', { locale }) + : format(d, 'MMM d, yyyy', { locale }); } catch { return ''; } @@ -94,6 +95,7 @@ export function ContactActivity({ contact }: Props) { const styles = React.useMemo(() => makeStyles(c), [c]); const navigation = useNavigation