Skip to content

Commit e328224

Browse files
fix: ci build failures (lint, typecheck, i18n)
- Fix ESLint import order in storage/index.ts - Fix TypeScript errors by using colon notation for i18n keys - Fix missing keys in non-English translation files - Fix import path in HomeScreen - Fix i18n tests
1 parent 08ad6e8 commit e328224

File tree

12 files changed

+127
-24
lines changed

12 files changed

+127
-24
lines changed

app/components/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export interface ButtonProps extends PressableProps {
9393
* @returns {JSX.Element} The rendered `Button` component.
9494
* @example
9595
* <Button
96-
* tx="common.ok"
96+
* tx="common:ok"
9797
* style={styles.button}
9898
* textStyle={styles.buttonText}
9999
* onPress={handleButtonPress}

app/components/EmptyState.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ export function EmptyState(props: EmptyStateProps) {
126126
const EmptyStatePresets = {
127127
generic: {
128128
imageSource: sadFace,
129-
heading: translate("emptyStateComponent.generic.heading"),
130-
content: translate("emptyStateComponent.generic.content"),
131-
button: translate("emptyStateComponent.generic.button"),
129+
heading: translate("emptyStateComponent:generic.heading"),
130+
content: translate("emptyStateComponent:generic.content"),
131+
button: translate("emptyStateComponent:generic.button"),
132132
} as EmptyStatePresetItem,
133133
} as const
134134

app/i18n/ar.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ const ar: Translations = {
55
ok: "نعم",
66
cancel: "حذف",
77
back: "خلف",
8+
delete: "Delete",
9+
},
10+
homeScreen: {
11+
title: "My Collection",
12+
headerTitle: "🏠 My Collection",
13+
subtitle: "Your captured moments",
14+
deleteAlertTitle: "Delete Encounter",
15+
deleteAlertMessage:
16+
"Are you sure you want to delete this {{petType}} encounter? This cannot be undone.",
17+
emptyState: {
18+
title: "No encounters yet",
19+
description: "Tap the camera to start your pet collection journey!",
20+
suggestionTitle: "💡 Try capturing:",
21+
suggestion1: "• Your neighbor's cat or dog",
22+
suggestion2: "• Pets at the park",
23+
suggestion3: "• Wildlife you encounter",
24+
},
825
},
926
welcomeScreen: {
1027
postscript:

app/i18n/es.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ const es: Translations = {
55
ok: "OK",
66
cancel: "Cancelar",
77
back: "Volver",
8+
delete: "Delete",
9+
},
10+
homeScreen: {
11+
title: "My Collection",
12+
headerTitle: "🏠 My Collection",
13+
subtitle: "Your captured moments",
14+
deleteAlertTitle: "Delete Encounter",
15+
deleteAlertMessage:
16+
"Are you sure you want to delete this {{petType}} encounter? This cannot be undone.",
17+
emptyState: {
18+
title: "No encounters yet",
19+
description: "Tap the camera to start your pet collection journey!",
20+
suggestionTitle: "💡 Try capturing:",
21+
suggestion1: "• Your neighbor's cat or dog",
22+
suggestion2: "• Pets at the park",
23+
suggestion3: "• Wildlife you encounter",
24+
},
825
},
926
welcomeScreen: {
1027
postscript:

app/i18n/fr.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ const fr: Translations = {
55
ok: "OK !",
66
cancel: "Annuler",
77
back: "Retour",
8+
delete: "Delete",
9+
},
10+
homeScreen: {
11+
title: "My Collection",
12+
headerTitle: "🏠 My Collection",
13+
subtitle: "Your captured moments",
14+
deleteAlertTitle: "Delete Encounter",
15+
deleteAlertMessage:
16+
"Are you sure you want to delete this {{petType}} encounter? This cannot be undone.",
17+
emptyState: {
18+
title: "No encounters yet",
19+
description: "Tap the camera to start your pet collection journey!",
20+
suggestionTitle: "💡 Try capturing:",
21+
suggestion1: "• Your neighbor's cat or dog",
22+
suggestion2: "• Pets at the park",
23+
suggestion3: "• Wildlife you encounter",
24+
},
825
},
926
welcomeScreen: {
1027
postscript:

app/i18n/hi.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ const hi: Translations = {
55
ok: "ठीक है!",
66
cancel: "रद्द करें",
77
back: "वापस",
8+
delete: "Delete",
9+
},
10+
homeScreen: {
11+
title: "My Collection",
12+
headerTitle: "🏠 My Collection",
13+
subtitle: "Your captured moments",
14+
deleteAlertTitle: "Delete Encounter",
15+
deleteAlertMessage:
16+
"Are you sure you want to delete this {{petType}} encounter? This cannot be undone.",
17+
emptyState: {
18+
title: "No encounters yet",
19+
description: "Tap the camera to start your pet collection journey!",
20+
suggestionTitle: "💡 Try capturing:",
21+
suggestion1: "• Your neighbor's cat or dog",
22+
suggestion2: "• Pets at the park",
23+
suggestion3: "• Wildlife you encounter",
24+
},
825
},
926
welcomeScreen: {
1027
postscript:

app/i18n/ja.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ const ja: Translations = {
55
ok: "OK",
66
cancel: "キャンセル",
77
back: "戻る",
8+
delete: "Delete",
9+
},
10+
homeScreen: {
11+
title: "My Collection",
12+
headerTitle: "🏠 My Collection",
13+
subtitle: "Your captured moments",
14+
deleteAlertTitle: "Delete Encounter",
15+
deleteAlertMessage:
16+
"Are you sure you want to delete this {{petType}} encounter? This cannot be undone.",
17+
emptyState: {
18+
title: "No encounters yet",
19+
description: "Tap the camera to start your pet collection journey!",
20+
suggestionTitle: "💡 Try capturing:",
21+
suggestion1: "• Your neighbor's cat or dog",
22+
suggestion2: "• Pets at the park",
23+
suggestion3: "• Wildlife you encounter",
24+
},
825
},
926
welcomeScreen: {
1027
postscript:

app/i18n/ko.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ const ko: Translations = {
55
ok: "확인!",
66
cancel: "취소",
77
back: "뒤로",
8+
delete: "Delete",
9+
},
10+
homeScreen: {
11+
title: "My Collection",
12+
headerTitle: "🏠 My Collection",
13+
subtitle: "Your captured moments",
14+
deleteAlertTitle: "Delete Encounter",
15+
deleteAlertMessage:
16+
"Are you sure you want to delete this {{petType}} encounter? This cannot be undone.",
17+
emptyState: {
18+
title: "No encounters yet",
19+
description: "Tap the camera to start your pet collection journey!",
20+
suggestionTitle: "💡 Try capturing:",
21+
suggestion1: "• Your neighbor's cat or dog",
22+
suggestion2: "• Pets at the park",
23+
suggestion3: "• Wildlife you encounter",
24+
},
825
},
926
welcomeScreen: {
1027
postscript:

app/screens/ErrorScreen/ErrorDetails.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export function ErrorDetails(props: ErrorDetailsProps) {
2929
>
3030
<View style={$topSection}>
3131
<Icon icon="ladybug" size={64} />
32-
<Text style={themed($heading)} preset="subheading" tx="errorScreen.title" />
33-
<Text tx="errorScreen.friendlySubtitle" />
32+
<Text style={themed($heading)} preset="subheading" tx="errorScreen:title" />
33+
<Text tx="errorScreen:friendlySubtitle" />
3434
</View>
3535

3636
<ScrollView
@@ -49,7 +49,7 @@ export function ErrorDetails(props: ErrorDetailsProps) {
4949
preset="reversed"
5050
style={themed($resetButton)}
5151
onPress={props.onReset}
52-
tx="errorScreen.reset"
52+
tx="errorScreen:reset"
5353
/>
5454
</Screen>
5555
)

app/screens/HomeScreen.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { Svg, Defs, Pattern, Circle, Rect } from "react-native-svg"
1515
import { BackgroundDecorations } from "@/components/BackgroundDecorations"
1616
import { Screen } from "@/components/Screen"
1717
import { Text } from "@/components/Text"
18-
import { translate } from "@/i18n"
18+
import { translate } from "@/i18n/translate"
1919
import { useStores } from "@/models"
2020
import type { MainTabScreenProps } from "@/navigators/navigationTypes"
2121
import { useAppTheme } from "@/theme/context"
@@ -31,12 +31,12 @@ export const HomeScreen = observer(function HomeScreen(_props: MainTabScreenProp
3131
// Handle delete encounter with confirmation
3232
const handleDeleteEncounter = (id: string, petType: string) => {
3333
Alert.alert(
34-
translate("homeScreen.deleteAlertTitle"),
35-
translate("homeScreen.deleteAlertMessage", { petType }),
34+
translate("homeScreen:deleteAlertTitle"),
35+
translate("homeScreen:deleteAlertMessage", { petType }),
3636
[
37-
{ text: translate("common.cancel"), style: "cancel" },
37+
{ text: translate("common:cancel"), style: "cancel" },
3838
{
39-
text: translate("common.delete"),
39+
text: translate("common:delete"),
4040
style: "destructive",
4141
onPress: () => encountersStore.removeEncounter(id),
4242
},
@@ -89,33 +89,33 @@ export const HomeScreen = observer(function HomeScreen(_props: MainTabScreenProp
8989
{/* Header */}
9090
<View style={$headerContainer}>
9191
<View style={$headerTop}>
92-
<Text preset="heading" tx="homeScreen.headerTitle" />
92+
<Text preset="heading" tx="homeScreen:headerTitle" />
9393
</View>
9494
</View>
9595

9696
{/* Enhanced Empty State */}
9797
<View style={$emptyStateContainer}>
9898
<Text style={$emptyIcon} text="📷🐾" />
99-
<Text preset="subheading" tx="homeScreen.emptyState.title" style={$emptyStateTitle} />
99+
<Text preset="subheading" tx="homeScreen:emptyState.title" style={$emptyStateTitle} />
100100
<Text
101101
style={[$emptyDescription, { color: colors.textDim }]}
102-
tx="homeScreen.emptyState.description"
102+
tx="homeScreen:emptyState.description"
103103
/>
104104

105105
{/* Suggestions Card */}
106106
<View style={[$suggestionCard, { backgroundColor: colors.palette.primary100 }]}>
107-
<Text style={$suggestionTitle} tx="homeScreen.emptyState.suggestionTitle" />
107+
<Text style={$suggestionTitle} tx="homeScreen:emptyState.suggestionTitle" />
108108
<Text
109109
style={[$suggestionItem, { color: colors.textDim }]}
110-
tx="homeScreen.emptyState.suggestion1"
110+
tx="homeScreen:emptyState.suggestion1"
111111
/>
112112
<Text
113113
style={[$suggestionItem, { color: colors.textDim }]}
114-
tx="homeScreen.emptyState.suggestion2"
114+
tx="homeScreen:emptyState.suggestion2"
115115
/>
116116
<Text
117117
style={[$suggestionItem, { color: colors.textDim }]}
118-
tx="homeScreen.emptyState.suggestion3"
118+
tx="homeScreen:emptyState.suggestion3"
119119
/>
120120
</View>
121121
</View>
@@ -136,8 +136,8 @@ export const HomeScreen = observer(function HomeScreen(_props: MainTabScreenProp
136136

137137
{/* Header Section with Gradient */}
138138
<View style={$headerContainer}>
139-
<Text preset="heading" tx="homeScreen.title" style={$headerTitle} />
140-
<Text tx="homeScreen.subtitle" style={$headerSubtitle} />
139+
<Text preset="heading" tx="homeScreen:title" style={$headerTitle} />
140+
<Text tx="homeScreen:subtitle" style={$headerSubtitle} />
141141
</View>
142142

143143
{/* Grid List */}

0 commit comments

Comments
 (0)