Skip to content

Commit

Permalink
Translated additional text post rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
balog-b committed Feb 13, 2024
1 parent 0cbddf8 commit 3c8737e
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 14 deletions.
6 changes: 4 additions & 2 deletions app/(tabs)/map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ import { Header } from '../../components/common/header';
import { Title } from '../../components/common/title';
import { Map } from '../../components/map/map';
import { ResourceSheet } from '../../components/map/resource-sheet';
import { MapResources } from '../../content/map-resources.content';
import { MapResources_en } from '../../content/map-resources-en.content';
import { MapResources_hu } from '../../content/map-resources-hu.content';
import { MapResource } from '../../types/map.type';

export default function MapPage() {
const { t } = useTranslation();
const [selectedResource, setSelectedResource] = useState<MapResource>();

const onSelectedResource = (id: string) => {
const res = MapResources.find((r) => r.id === id);
const localizedResource = t('map.key') === 'hu' ? MapResources_hu : MapResources_en;
const res = localizedResource.find((r) => r.id === id);
setSelectedResource(res);
};

Expand Down
6 changes: 4 additions & 2 deletions app/(tabs)/presentation/favorite-presentations.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { useTranslation } from 'react-i18next';

import { Screen } from '../../../components/base/screen';
import { ErrorMessage } from '../../../components/common/error-message';
Expand All @@ -10,14 +11,15 @@ import { useFavoritePresentationsList } from '../../../hooks/use-favorite-presen

export default function FavoritePresentationsScreen() {
const { data, isLoading, isError } = useFavoritePresentationsList();
const { t } = useTranslation();
return (
<Screen analyticsScreenName='favorite-presentations'>
<Header>
<Title>Kedvenc előadásaim</Title>
<Title>{t('presentations.favoritesTitle')}</Title>
</Header>
{isLoading && <PresentationItemSkeletonList />}
{!isError && !isLoading && <PresentationList presentations={data ?? []} />}
{isError && <ErrorMessage>Nem sikerült betölteni az előadásokat</ErrorMessage>}
{isError && <ErrorMessage>{t('presentations.error')}</ErrorMessage>}
</Screen>
);
}
2 changes: 1 addition & 1 deletion app/(tabs)/presentation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function PresentationListPage() {
</Header>
<Link href='/presentation/favorite-presentations' asChild>
<StyledButton variant='outline' rightIcon='arrow-right' className='mt-4 mx-5'>
Kedvenceim
{t('presentations.favorites')}
</StyledButton>
</Link>
{isLoading && <PresentationItemSkeletonList />}
Expand Down
8 changes: 5 additions & 3 deletions app/[...unmatched].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useRouter } from 'expo-router';
import { useTranslation } from 'react-i18next';
import { SafeAreaView } from 'react-native';

import { StyledButton } from '../components/common/styled-button';
Expand All @@ -8,14 +9,15 @@ import { usePageView } from '../utils/analytics.utils';

export default function Unmatched() {
const { canGoBack, back } = useRouter();
const { t } = useTranslation();
usePageView('unmatched');
return (
<SafeAreaView className='items-center justify-center flex-grow space-y-5'>
<Title className='text-center'>Ismeretlen képernyőre jutottál</Title>
<Subtitle className='text-center'>Ilyet mi itt nem tartunk</Subtitle>
<Title className='text-center'>{t('unmatched.main')}</Title>
<Subtitle className='text-center'>{t('unmatched.sub')}</Subtitle>
{canGoBack() && (
<StyledButton leftIcon='arrow-left' onPress={back}>
Vissza
{t('unmatched.back')}
</StyledButton>
)}
</SafeAreaView>
Expand Down
8 changes: 5 additions & 3 deletions components/common/error-boundary.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ErrorBoundaryProps } from 'expo-router';
import { useTranslation } from 'react-i18next';
import { ScrollView, View } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';

Expand All @@ -9,6 +10,7 @@ import { Title } from './title';

export function ErrorBoundary(props: ErrorBoundaryProps) {
const { top, bottom, left, right } = useSafeAreaInsets();
const { t } = useTranslation();
usePageView('error');
return (
<View
Expand All @@ -20,13 +22,13 @@ export function ErrorBoundary(props: ErrorBoundaryProps) {
paddingRight: right + 20,
}}
>
<Title className='text-white'>Hopp, ez elszállt :(</Title>
<Title className='text-white'>{t('errBoundary.main')}</Title>
<ScrollView>
<Subtitle className='text-white/50 flex-shrink'>{props.error.message}</Subtitle>
</ScrollView>
<Subtitle className='text-white/50'>Kérlek ezt jelezd a fejlesztőknek!</Subtitle>
<Subtitle className='text-white/50'>{t('errBoundary.sub')}</Subtitle>
<StyledButton onPress={props.retry} className='bg-blue-900'>
Újrapróbálkozás
{t('errBoundary.retry')}
</StyledButton>
</View>
);
Expand Down
174 changes: 174 additions & 0 deletions content/map-resources-en.content.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
import { MapResource } from '../types/map.type';

export const MapResources_en: MapResource[] = [
{
id: 'DOOR',
title: 'Entrance',
description: '',
},
{
id: 'COFFEE',
title: 'Chill corner',
description: 'Relax with a cup of coffee in hand!',
},
{
id: 'IB028',
title: 'IB028 Lecture Hall',
description: '',
},
{
id: 'IB025',
title: 'IB025 Lecture Hall',
description: '',
},
{
id: 'VIP',
title: 'VIP',
description: '',
},
{
id: 'ORG',
title: 'Organizers',
description: '',
},
{
id: 'K1',
title: 'Kör',
description: 'Ez itt egy szakmai kör.',
},
{
id: 'K4',
title: 'Kör',
description: 'Ez itt egy szakmai kör.',
},
{
id: 'K5',
title: 'Kör',
description: 'Ez itt egy szakmai kör.',
},
{
id: 'K2',
title: 'Kör',
description: 'Ez itt egy szakmai kör.',
},
{
id: 'K3',
title: 'Kör',
description: 'Ez itt egy szakmai kör.',
},
{
id: 'T5',
title: 'Department',
description: 'This is a department.',
},
{
id: 'T4',
title: 'Department',
description: 'This is a department.',
},
{
id: 'T3',
title: 'Department',
description: 'This is a department.',
},
{
id: 'T2',
title: 'Department',
description: 'This is a department.',
},
{
id: 'T1',
title: 'Department',
description: 'This is a department.',
},
{
id: 'C9',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C8',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C7',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C6',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C5',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C4',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C3',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C12',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C13',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C14',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C15',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C10',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C11',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C2',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'C1',
title: 'Company',
description: 'This is a Company.',
},
{
id: 'WC',
title: 'Toilet',
description: '',
},
{
id: 'WC_2',
title: 'Toilet',
description: '',
},
{
id: 'WC_3',
title: 'Toilet',
description: '',
},
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MapResource } from '../types/map.type';

export const MapResources: MapResource[] = [
export const MapResources_hu: MapResource[] = [
{
id: 'DOOR',
title: 'Bejárat',
Expand Down
34 changes: 32 additions & 2 deletions services/i18n_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,30 @@ export const resources = {
empty: 'No presentations available.',
noNews: 'No news available',
},
persentations: {
presentations: {
title: 'Schedule',
error: 'Unable load presentations',
empty: 'No presentations available.',
favorites: 'Favorites',
favoritesTitle: 'Favorite presentations',
},
news: {
highlight: 'Highlight',
error: "Encountered an error while loading the news. Perhaps it doesn't exist?",
},
map: {
key: 'en',
},
unmatched: {
main: 'You have reached an unmatched route',
sub: 'Please return to the previous page',
back: 'Back',
},
errBoundary: {
main: 'Whoops! The app has ran into a problem :(',
sub: 'Please contact the developers',
retry: 'Retry',
},
},
},
hu: {
Expand All @@ -40,15 +55,30 @@ export const resources = {
empty: 'Nincs megjeleníthető előadás.',
noNews: 'Nincs megjeleníthető hír.',
},
persentations: {
presentations: {
title: 'Programterv',
error: 'Nem sikerült betölteni az előadásokat',
empty: 'Nincs megjeleníthető előadás.',
favorites: 'Kedvenceim',
favoritesTitle: 'Kedvenc előadásaim',
},
news: {
highlight: 'Kiemelt',
error: 'Hiba történt a hír betöltése közben. Lehet, hogy ez a hír nem is létezik?',
},
map: {
key: 'hu',
},
unmatched: {
main: 'Ismeretlen képernyőre jutottál',
sub: 'Ilyet mi itt nem tartunk',
back: 'Vissza',
},
errBoundary: {
main: 'Hopp, ez elszállt :(',
sub: 'Kérlek ezt jelezd a fejlesztőknek!',
retry: 'Újrapróbálkozás',
},
},
},
};

0 comments on commit 3c8737e

Please sign in to comment.