Skip to content

Commit

Permalink
feat: map translations
Browse files Browse the repository at this point in the history
  • Loading branch information
balog-b committed Mar 14, 2024
1 parent 73f5623 commit 65fb74d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/map/resource-sheet.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import i18n from 'i18next';
import { useEffect, useState } from 'react';
import { Animated, ViewProps } from 'react-native';

Expand Down Expand Up @@ -36,10 +37,12 @@ export function ResourceSheet({ resource, className, ...props }: ResourceSheetPr
{...props}
>
<StyledText className='text-2xl'>
{savedResource?.title}
{i18n.language == 'en' && savedResource?.enTitle !== undefined ? savedResource?.enTitle : savedResource?.title}
{DISPLAY_ID && ` (${savedResource?.id})`}
</StyledText>
<StyledText className='text-slate-500 text-lg'>{savedResource?.description.hu}</StyledText>
<StyledText className='text-slate-500 text-lg'>
{i18n.language == 'en' ? savedResource?.description.en : savedResource?.description.hu}
</StyledText>
</Animated.View>
);
}
10 changes: 10 additions & 0 deletions content/map-resources.content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const MapResources: MapResource[] = [
{
id: 'DOOR',
title: 'Bejárat',
enTitle: 'Entrance',
description: {
hu: 'Itt jössz be!',
en: 'This is the entrance!',
Expand All @@ -12,6 +13,7 @@ export const MapResources: MapResource[] = [
{
id: 'COFFEE',
title: 'Chill sarok',
enTitle: 'Chill corner',
description: {
hu: 'Kapcsolódj ki egy kávé mellett!',
en: 'Relax with a coffee!',
Expand All @@ -20,6 +22,7 @@ export const MapResources: MapResource[] = [
{
id: 'COAT',
title: 'Ruhatár',
enTitle: 'Cloakroom',
description: {
hu: 'Itt hagyhatod a kabátod!',
en: 'You can leave your coat here!',
Expand All @@ -28,6 +31,7 @@ export const MapResources: MapResource[] = [
{
id: 'REGISTRATION',
title: 'Regisztráció',
enTitle: 'Registration',
description: {
hu: 'Itt indul minden!',
en: 'This is where everything starts!',
Expand All @@ -36,6 +40,7 @@ export const MapResources: MapResource[] = [
{
id: 'IB028',
title: 'IB028-as előadó',
enTitle: 'Hall IB028',
description: {
hu: 'A legnagyobb előadóterem!',
en: 'The biggest lecture hall!',
Expand All @@ -44,6 +49,7 @@ export const MapResources: MapResource[] = [
{
id: 'IB025',
title: 'IB025-ös előadó',
enTitle: 'Hall IB025',
description: {
hu: 'Egy kisebb előadóterem!',
en: 'A smaller lecture hall!',
Expand All @@ -60,6 +66,7 @@ export const MapResources: MapResource[] = [
{
id: 'ORG',
title: 'Rendezők',
enTitle: 'Organizers',
description: {
hu: 'Itt találod a rendezőket!',
en: 'You can find the organizers here!',
Expand Down Expand Up @@ -244,6 +251,7 @@ export const MapResources: MapResource[] = [
{
id: 'WC',
title: 'Mosdó',
enTitle: 'Restroom',
description: {
hu: 'Itt találod a mosdót!',
en: 'You can find the toilet here!',
Expand All @@ -252,6 +260,7 @@ export const MapResources: MapResource[] = [
{
id: 'WC_2',
title: 'Mosdó',
enTitle: 'Restroom',
description: {
hu: 'Itt találod a mosdót!',
en: 'You can find the toilet here!',
Expand All @@ -260,6 +269,7 @@ export const MapResources: MapResource[] = [
{
id: 'WC_3',
title: 'Mosdó',
enTitle: 'Restroom',
description: {
hu: 'Itt találod a mosdót!',
en: 'You can find the toilet here!',
Expand Down
1 change: 1 addition & 0 deletions types/map.type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type MapResource = {
id: string;
title: string;
enTitle?: string;
description: {
hu: string;
en: string;
Expand Down

0 comments on commit 65fb74d

Please sign in to comment.