Skip to content

Commit

Permalink
Polish translations
Browse files Browse the repository at this point in the history
  • Loading branch information
kubaczerwinski77 committed Oct 13, 2023
1 parent 0b77cf2 commit c178a1b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
15 changes: 9 additions & 6 deletions app/profile/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { Link, Stack } from "expo-router";
import { ScrollView, StyleSheet, View } from "react-native";
import { Avatar, Button, List } from "react-native-paper";

import { useI18n } from "@/util/i18n";

const mockApiResponse = {
profiles: [
{ type: "caretaker", seniorId: "2137" },
Expand All @@ -11,6 +13,7 @@ const mockApiResponse = {
};

const ProfilesList = () => {
const { t } = useI18n();
const profiles = mockApiResponse.profiles;
const seniorProfile = profiles.find(({ type }) => type === "senior");
const hasCaretakerProfile = profiles.some(({ type }) => type === "caretaker");
Expand All @@ -21,11 +24,11 @@ const ProfilesList = () => {

return (
<View style={styles.container}>
<Stack.Screen options={{ title: "Profiles" }} />
<Stack.Screen options={{ title: t("profileList.pageTitle") }} />
<List.Section>
{hasCaretakerProfile && (
<List.Subheader style={styles.listSubheader}>
Caretaker profiles
{t("profileList.caretakersHeader")}
</List.Subheader>
)}
<ScrollView style={styles.scrollView}>
Expand All @@ -35,7 +38,7 @@ const ProfilesList = () => {
return (
<List.Item
key={seniorId}
title="Caretaker"
title={t("profileList.caretakerNameFallback")}
description={`Senior ID: ${seniorId}`}
onPress={() => handleItemPress(seniorId)}
style={styles.listItem}
Expand All @@ -55,10 +58,10 @@ const ProfilesList = () => {
{seniorProfile && (
<>
<List.Subheader style={styles.listSubheader}>
Your senior profile
{t("profileList.seniorHeader")}
</List.Subheader>
<List.Item
title="Senior"
title={t("profileList.seniorNameFallback")}
description={`Senior ID: ${seniorProfile.seniorId}`}
onPress={() => handleItemPress(seniorProfile.seniorId)}
style={styles.listItem}
Expand All @@ -78,7 +81,7 @@ const ProfilesList = () => {
<View style={styles.newProfileButtonWrapper}>
<Link href="/profile/add">
<Button icon="plus" mode="contained" uppercase>
Add new profile
{t("profileList.newProfileButton")}
</Button>
</Link>
</View>
Expand Down
24 changes: 24 additions & 0 deletions assets/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,29 @@
"landing.tryAgain": {
"en": "Try again",
"pl": "Spróbuj ponownie"
},
"profileList.pageTitle": {
"en": "Profiles",
"pl": "Profile"
},
"profileList.caretakersHeader": {
"en": "Caretaker profiles",
"pl": "Profile opiekunów"
},
"profileList.caretakerNameFallback": {
"en": "Caretaker",
"pl": "Opiekun"
},
"profileList.seniorHeader": {
"en": "Your senior profile",
"pl": "Twój profil seniora"
},
"profileList.seniorNameFallback": {
"en": "Senior",
"pl": "Senior"
},
"profileList.newProfileButton": {
"en": "Add new profile",
"pl": "Dodaj nowy profil"
}
}

0 comments on commit c178a1b

Please sign in to comment.