Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2026-04-24 - Missing translation keys break typecheck
**Learning:** When adding accessibility labels to icon-only buttons via `useLanguage` hook and `t('...')` in this React Native app, adding the new key to `src/i18n/translations.ts` in the base language object (`it`) but missing it in other type-checked language objects (like `const en: typeof it = {...}`) will cause `npm run typecheck` to fail with TS2741.
**Action:** Always verify that newly added translation keys are duplicated across all language dictionary objects in `translations.ts` to satisfy TypeScript's strict type checking.
8 changes: 7 additions & 1 deletion src/components/DrawerMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,13 @@ export default function DrawerMenu({ visible, onClose, onSelect }: Props) {
style={styles.headerGradient}
>
<AeroStaffLogo variant="large" monochrome />
<TouchableOpacity onPress={onClose} style={styles.closeIconBtn}>
<TouchableOpacity
onPress={onClose}
style={styles.closeIconBtn}
accessible={true}
accessibilityRole="button"
accessibilityLabel={t('close')}
>
<MaterialIcons name="close" size={20} color="rgba(255,255,255,0.7)" />
</TouchableOpacity>
</LinearGradient>
Expand Down
8 changes: 7 additions & 1 deletion src/components/ShiftTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ export default function ShiftTimeline({ visible, onClose, shiftStart, shiftEnd,
<Text style={[s.title, { color: colors.primaryDark }]}>Voli nel Turno</Text>
<Text style={[s.subtitle, { color: colors.textSub }]}>{fmtTime(startSec)} – {fmtTime(endSec)}</Text>
</View>
<TouchableOpacity onPress={onClose} style={s.closeBtn}>
<TouchableOpacity
onPress={onClose}
style={s.closeBtn}
accessible={true}
accessibilityRole="button"
accessibilityLabel={t('close')}
>
<MaterialIcons name="close" size={22} color={colors.textSub} />
</TouchableOpacity>
</View>
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const it = {
overlayNotepad: 'Blocco Note', overlayPhonebook: 'Rubrica', overlayPasswords: 'Password',
overlayManuals: 'Manuali DCS', overlaySettings: 'Impostazioni',
// Common
cancel: 'Annulla', save: 'Salva', delete: 'Elimina', error: 'Errore',
close: 'Chiudi', cancel: 'Annulla', save: 'Salva', delete: 'Elimina', error: 'Errore',
confirm: 'Conferma', ok: 'OK', add: 'Aggiungi',
// Settings
settingsTitle: 'Impostazioni',
Expand Down Expand Up @@ -164,7 +164,7 @@ const en: typeof it = {
overlayNotepad: 'Notepad', overlayPhonebook: 'Phonebook', overlayPasswords: 'Password',
overlayManuals: 'DCS Manuals', overlaySettings: 'Settings',
// Common
cancel: 'Cancel', save: 'Save', delete: 'Delete', error: 'Error',
close: 'Close', cancel: 'Cancel', save: 'Save', delete: 'Delete', error: 'Error',
confirm: 'Confirm', ok: 'OK', add: 'Add',
// Settings
settingsTitle: 'Settings',
Expand Down
Loading