Skip to content

Commit 876e86e

Browse files
authored
Merge pull request #866 from Plant-for-the-Planet-org/feature/translation
Feature/translation
2 parents d3c65dc + 1f5a469 commit 876e86e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+884
-521
lines changed

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "TreeMapper",
44
"slug": "treemapper",
5-
"version": "2.0.3",
5+
"version": "2.0.4",
66
"orientation": "portrait",
77
"icon": "./assets/icon.png",
88
"userInterfaceStyle": "light",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"@expo/metro-runtime": "~3.2.1",
1616
"@expo/vector-icons": "^14.0.0",
1717
"@gorhom/bottom-sheet": "^4.6.3",
18-
"@maplibre/maplibre-react-native": "10.0.0-alpha.2",
18+
"@maplibre/maplibre-react-native": "10.0.0-alpha.28",
1919
"@react-native-async-storage/async-storage": "1.23.1",
2020
"@react-native-community/datetimepicker": "8.0.1",
2121
"@react-native-community/netinfo": "11.3.1",

patches/@maplibre+maplibre-react-native+10.0.0-alpha.2.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/components/carousel/CarouselItem.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
1+
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native'
2+
import * as ExpoImage from 'expo-image';
23
import React from 'react'
34
import { scaleFont } from 'src/utils/constants/mixins'
45
import { Colors, Typography } from 'src/utils/constants'
@@ -24,7 +25,7 @@ const CarouselItem = (props: Props) => {
2425
onPress(data.intervention_id, data.tree_id)
2526
}}>
2627
<View style={styles.imageWrapper}>
27-
{hasImage ? <Image style={styles.imageContainer} source={{ uri: uri }} /> : <SingleTreeIcon width={SCALE_36} height={SCALE_36} />
28+
{hasImage ? <ExpoImage.Image cachePolicy='memory-disk' style={styles.imageContainer} source={{ uri: uri }} /> : <SingleTreeIcon width={SCALE_36} height={SCALE_36} />
2829
}
2930
</View>
3031
<View style={styles.sectionWrapper}>

src/components/common/CountryModal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
StyleSheet,
77
FlatList,
88
TouchableOpacity,
9-
Image,
109
Platform,
1110
} from 'react-native';
1211

@@ -15,6 +14,7 @@ import { Typography, Colors } from 'src/utils/constants'
1514
import CountryData from 'src/utils/constants/countryData.json';
1615
import i18next from 'i18next';
1716
import { CountryCode } from 'src/types/interface/slice.interface';
17+
import * as ExpoImage from 'expo-image';
1818

1919

2020
const cdnUrl = process.env.EXPO_PUBLIC_CDN_URL
@@ -31,12 +31,13 @@ interface Props {
3131
const Item = ({ title, onPress }: { title: CountryCode, onPress: () => void }) => (
3232
<TouchableOpacity style={styles.item} onPress={onPress}>
3333
<View style={{ flexDirection: 'row' }}>
34-
<Image
34+
<ExpoImage.Image
35+
cachePolicy='memory-disk'
3536
source={{
3637
uri: cdnUrl ? `${protocol}://${cdnUrl}/media/images/flags/png/256/${title.countryCode}.png` : null,
3738
}}
3839
style={styles.countryFlag}
39-
resizeMode="contain"
40+
contentFit="contain"
4041
/>
4142
<View style={{ paddingLeft: 20 }}>
4243
<Text style={{ color: 'black', paddingTop: 12 }}>{title.countryName}</Text>
@@ -56,7 +57,7 @@ export default function CountryModal(props: Props) {
5657
const selectCountry = (data: CountryCode) => {
5758
userCountry(data);
5859
};
59-
60+
6061
const sort = () => {
6162
CountryData.sort((a, b) => {
6263
if (a.countryName > b.countryName) {

src/components/common/MapAttribution.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import InfoIcon from 'assets/images/svg/InfoIcon.svg'
44
import Modal from 'react-native-modal'
55
import { Colors, Typography } from 'src/utils/constants'
66
import CustomButton from './CustomButton'
7+
import i18next from 'src/locales/index'
78

89

910

@@ -23,7 +24,7 @@ const MapAttribution = () => {
2324
onBackdropPress={toggleInfo}>
2425
<View style={styles.sectionWrapper}>
2526
<Text style={styles.header}>
26-
Map credits:
27+
{i18next.t('label.map_credits')}
2728
</Text>
2829
<Text style={styles.mapLabels}>
2930
Maplibre SDK
@@ -32,7 +33,7 @@ const MapAttribution = () => {
3233
ESRI
3334
</Text>
3435
<Text style={styles.mapLabels}>
35-
OpenStreetMap Contributors
36+
{i18next.t('label.openstreet_contributors')}
3637
</Text>
3738
<CustomButton label={'Close'} pressHandler={toggleInfo}
3839
containerStyle={{width:'100%',height:70, marginTop:'5%'}}

src/components/common/SpeciesSync.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ const SpeciesSync = () => {
311311
<RotatingView isClockwise={true}>
312312
<RefreshIcon />
313313
</RotatingView>
314-
<Text style={styles.label}>Species {i18next.t("label.syncing")}</Text>
314+
<Text style={styles.label}>{i18next.t("label.species_caps")}{i18next.t("label.syncing")}</Text>
315315
</View>
316316
)
317317
}

src/components/intervention/InterventionCard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ const InterventionCard = (props: Props) => {
6464
item={item}
6565
overSwipe={OVERSWIPE_DIST}
6666
renderUnderlayLeft={() => (swipeableLeftComp())}
67-
renderUnderlayRight={() => <Text>Right</Text>}
6867
snapPointsLeft={item.status=== 'SYNCED'?[100]:[150]}
6968
snapPointsRight={[0]}
7069
>

src/components/manageProject/ProjectList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@ import i18next from 'src/locales/index'
22
import React from 'react'
33
import {
44
FlatList,
5-
Image,
65
StyleSheet,
76
Text,
87
TouchableOpacity,
98
View,
109
} from 'react-native'
1110
import PlantProjectBackdrop from 'assets/images/svg/PlantProjectIcon.svg'
1211
import { Colors, Typography } from 'src/utils/constants'
13-
1412
import openWebView from 'src/utils/helpers/appHelper/openWebView'
1513
import LargeButton from 'src/components/common/LargeButton'
1614
import { useQuery } from '@realm/react'
1715
import { RealmSchema } from 'src/types/enum/db.enum'
1816
import { handleFilter } from 'src/utils/constants/CountryDataFilter'
17+
import * as ExpoImage from 'expo-image';
1918

2019
interface ProjectListProps {
2120
isSelectable?: boolean;
@@ -95,11 +94,12 @@ const ProjectItem = ({
9594
isProjectSelected ? { borderColor: Colors.NEW_PRIMARY } : {},
9695
]}>
9796
{item.image && process.env.EXPO_PUBLIC_CDN_URL ? (
98-
<Image
97+
<ExpoImage.Image
9998
source={{
10099
uri: `${process.env.EXPO_PUBLIC_API_PROTOCOL}://${process.env.EXPO_PUBLIC_CDN_URL}/media/cache/project/medium/${item.image}`,
101100
}}
102101
style={styles.image}
102+
cachePolicy='memory-disk'
103103
/>
104104
) : (
105105
<View style={[styles.image, { paddingBottom: 10 }]}>

src/components/map/EditDisplayCurrentPolygonMarker.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react'
33
import { scaleFont, scaleSize } from 'src/utils/constants/mixins'
44
import { Colors, Typography } from 'src/utils/constants'
55
import BackIcon from 'assets/images/svg/BackIcon.svg'
6+
import i18next from 'i18next'
67

78
interface Props {
89

@@ -15,8 +16,8 @@ const EditDisplayCurrentPolygonMarker = (props: Props) => {
1516
<View style={styles.container}>
1617
<TouchableOpacity style={styles.backIcon} onPress={goBack}><BackIcon onPress={goBack} /></TouchableOpacity>
1718
<View style={styles.wrapper}>
18-
<Text style={styles.label}>Corner</Text>
19-
<Text style={styles.note}>Please select the point and drag</Text>
19+
<Text style={styles.label}>{i18next.t("label.corner")}</Text>
20+
<Text style={styles.note}>{i18next.t("label.please_drag_point")}</Text>
2021
</View>
2122
</View>
2223
)

0 commit comments

Comments
 (0)