Browse Source

Added more information in proxiwash about screen + added more translations

keplyx 4 years ago
parent
commit
e83c3a834d

+ 4
- 9
screens/Proximo/ProximoAboutScreen.js View File

@@ -43,17 +43,12 @@ export default class ProximoAboutScreen extends React.Component<Props> {
43 43
                             style={{flex: 1, resizeMode: "contain"}}
44 44
                             resizeMode="contain"/>
45 45
                     </View>
46
-                    <Text>
47
-                        Le Proximo c’est ta petite épicerie étudiante tenu par les étudiants directement sur le
48
-                        campus. Ouvert tous les jours de 18h30 à 19h30, nous t’accueillons et te souvent quand tu n’as
49
-                        plus de pâtes ou de diluant ! Différents produits pour différentes galère, le tout à prix
50
-                        coûtant. Tu peux payer par Lydia ou par espèce.
51
-                    </Text>
46
+                    <Text>{i18n.t('proximoScreen.description')}</Text>
52 47
                     <Card>
53 48
                         <CardItem>
54 49
                             <Left>
55 50
                                 <CustomMaterialIcon icon={'clock-outline'}/>
56
-                                <H2>Horaires</H2>
51
+                                <H2>{i18n.t('proximoScreen.openingHours')}</H2>
57 52
                             </Left>
58 53
                         </CardItem>
59 54
                         <CardItem>
@@ -64,11 +59,11 @@ export default class ProximoAboutScreen extends React.Component<Props> {
64 59
                         <CardItem>
65 60
                             <Left>
66 61
                                 <CustomMaterialIcon icon={'cash'}/>
67
-                                <H2>Paiement</H2>
62
+                                <H2>{i18n.t('proximoScreen.paymentMethods')}</H2>
68 63
                             </Left>
69 64
                         </CardItem>
70 65
                         <CardItem>
71
-                            <Text>Espèce ou Lydia</Text>
66
+                            <Text>{i18n.t('proximoScreen.paymentMethodsDescription')}</Text>
72 67
                         </CardItem>
73 68
                     </Card>
74 69
                 </Content>

+ 47
- 24
screens/ProxiwashAboutScreen.js View File

@@ -2,7 +2,7 @@
2 2
 
3 3
 import * as React from 'react';
4 4
 import {Image, Linking, View} from 'react-native';
5
-import {Card, CardItem, Container, Content, H2, Left, Tab, TabHeading, Tabs, Text} from 'native-base';
5
+import {Body, Card, CardItem, Container, Content, H2, H3, Left, Tab, TabHeading, Tabs, Text} from 'native-base';
6 6
 import CustomHeader from "../components/CustomHeader";
7 7
 import i18n from "i18n-js";
8 8
 import CustomMaterialIcon from "../components/CustomMaterialIcon";
@@ -39,46 +39,64 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
39 39
                                     color={'#fff'}
40 40
                                     fontSize={20}
41 41
                                 />
42
-                                <Text>Information</Text>
42
+                                <Text>{i18n.t('proxiwashScreen.informationTab')}</Text>
43 43
                             </TabHeading>
44 44
                         }
45 45
                         key={1}
46 46
                         style={{backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor}}>
47
-                        <View style={{
48
-                            width: '100%',
49
-                            height: 100,
50
-                            marginTop: 20,
51
-                            marginBottom: 20,
52
-                            justifyContent: 'center',
53
-                            alignItems: 'center'
54
-                        }}>
55
-                            <Image
56
-                                source={require('../assets/proxiwash-logo.png')}
57
-                                style={{flex: 1, resizeMode: "contain"}}
58
-                                resizeMode="contain"/>
59
-                        </View>
60 47
                         <Content padder>
48
+                            <View style={{
49
+                                width: '100%',
50
+                                height: 100,
51
+                                marginTop: 20,
52
+                                marginBottom: 20,
53
+                                justifyContent: 'center',
54
+                                alignItems: 'center'
55
+                            }}>
56
+                                <Image
57
+                                    source={require('../assets/proxiwash-logo.png')}
58
+                                    style={{flex: 1, resizeMode: "contain"}}
59
+                                    resizeMode="contain"/>
60
+                            </View>
61 61
                             <Text>Ta laverie directement sur le campus, au pied du R3.</Text>
62 62
                             <Card>
63 63
                                 <CardItem>
64 64
                                     <Left>
65 65
                                         <CustomMaterialIcon icon={'tumble-dryer'}/>
66
-                                        <H2>Seche linge</H2>
66
+                                        <H2>{i18n.t('proxiwashScreen.dryer')}</H2>
67 67
                                     </Left>
68 68
                                 </CardItem>
69 69
                                 <CardItem>
70
-                                    <Text>Coucou</Text>
70
+                                    <Body>
71
+                                        <H3>{i18n.t('proxiwashScreen.procedure')}</H3>
72
+                                        <Text>{i18n.t('proxiwashScreen.dryerProcedure')}</Text>
73
+                                    </Body>
74
+                                </CardItem>
75
+                                <CardItem>
76
+                                    <Body>
77
+                                        <H3>{i18n.t('proxiwashScreen.tips')}</H3>
78
+                                        <Text>{i18n.t('proxiwashScreen.dryerTips')}</Text>
79
+                                    </Body>
71 80
                                 </CardItem>
72 81
                             </Card>
73 82
                             <Card>
74 83
                                 <CardItem>
75 84
                                     <Left>
76 85
                                         <CustomMaterialIcon icon={'washing-machine'}/>
77
-                                        <H2>Machine a laver</H2>
86
+                                        <H2>{i18n.t('proxiwashScreen.washer')}</H2>
78 87
                                     </Left>
79 88
                                 </CardItem>
80 89
                                 <CardItem>
81
-                                    <Text>Coucou</Text>
90
+                                    <Body>
91
+                                        <H3>{i18n.t('proxiwashScreen.procedure')}</H3>
92
+                                        <Text>{i18n.t('proxiwashScreen.washerProcedure')}</Text>
93
+                                    </Body>
94
+                                </CardItem>
95
+                                <CardItem>
96
+                                    <Body>
97
+                                        <H3>{i18n.t('proxiwashScreen.tips')}</H3>
98
+                                        <Text>{i18n.t('proxiwashScreen.washerTips')}</Text>
99
+                                    </Body>
82 100
                                 </CardItem>
83 101
                             </Card>
84 102
                         </Content>
@@ -91,7 +109,7 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
91 109
                                     color={'#fff'}
92 110
                                     fontSize={20}
93 111
                                 />
94
-                                <Text>Payment</Text>
112
+                                <Text>{i18n.t('proxiwashScreen.paymentTab')}</Text>
95 113
                             </TabHeading>
96 114
                         }
97 115
                         key={2}
@@ -101,22 +119,27 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
101 119
                                 <CardItem>
102 120
                                     <Left>
103 121
                                         <CustomMaterialIcon icon={'coins'}/>
104
-                                        <H2>Tarifs</H2>
122
+                                        <H2>{i18n.t('proxiwashScreen.tariffs')}</H2>
105 123
                                     </Left>
106 124
                                 </CardItem>
107 125
                                 <CardItem>
108
-                                    <Text>Coucou</Text>
126
+                                    <Body>
127
+                                        <Text>{i18n.t('proxiwashScreen.washersTariff')}</Text>
128
+                                        <Text>{i18n.t('proxiwashScreen.dryersTariff')}</Text>
129
+                                    </Body>
109 130
                                 </CardItem>
110 131
                             </Card>
111 132
                             <Card>
112 133
                                 <CardItem>
113 134
                                     <Left>
114 135
                                         <CustomMaterialIcon icon={'cash'}/>
115
-                                        <H2>Moyens de Paiement</H2>
136
+                                        <H2>{i18n.t('proxiwashScreen.paymentMethods')}</H2>
116 137
                                     </Left>
117 138
                                 </CardItem>
118 139
                                 <CardItem>
119
-                                    <Text>Coucou</Text>
140
+                                    <Body>
141
+                                        <Text>{i18n.t('proxiwashScreen.paymentMethodsDescription')}</Text>
142
+                                    </Body>
120 143
                                 </CardItem>
121 144
                             </Card>
122 145
                         </Content>

+ 11
- 4
screens/ProxiwashScreen.js View File

@@ -9,9 +9,9 @@ import CustomMaterialIcon from "../components/CustomMaterialIcon";
9 9
 import FetchedDataSectionList from "../components/FetchedDataSectionList";
10 10
 import NotificationsManager from "../utils/NotificationsManager";
11 11
 import PlatformTouchable from "react-native-platform-touchable";
12
+import Touchable from "react-native-platform-touchable";
12 13
 import AsyncStorageManager from "../utils/AsyncStorageManager";
13 14
 import * as Expo from "expo";
14
-import Touchable from "react-native-platform-touchable";
15 15
 
16 16
 const DATA_URL = "https://srv-falcon.etud.insa-toulouse.fr/~vergnet/appli-amicale/washinsa/washinsa.json";
17 17
 
@@ -296,8 +296,9 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
296 296
      * @param title
297 297
      * @param item
298 298
      * @param remainingTime
299
+     * @param isDryer
299 300
      */
300
-    showAlert(title: string, item: Object, remainingTime: number) {
301
+    showAlert(title: string, item: Object, remainingTime: number, isDryer: boolean) {
301 302
         let buttons = [{text: i18n.t("proxiwashScreen.modal.ok")}];
302 303
         let message = modalStateStrings[MACHINE_STATES[item.state]];
303 304
         if (MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"]) {
@@ -318,6 +319,11 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
318 319
                     end: item.endTime,
319 320
                     remaining: remainingTime
320 321
                 });
322
+        } else if (MACHINE_STATES[item.state] === MACHINE_STATES.DISPONIBLE) {
323
+            if (isDryer)
324
+                message += '\n' + i18n.t('proxiwashScreen.dryersTariff');
325
+            else
326
+                message += '\n' + i18n.t('proxiwashScreen.washersTariff');
321 327
         }
322 328
         Alert.alert(
323 329
             title,
@@ -349,6 +355,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
349 355
     getRenderItem(item: Object, section: Object, data: Object) {
350 356
         let isMachineRunning = MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"];
351 357
         let machineName = (section.title === i18n.t('proxiwashScreen.dryers') ? i18n.t('proxiwashScreen.dryer') : i18n.t('proxiwashScreen.washer')) + ' n°' + item.number;
358
+        let isDryer = section.title === i18n.t('proxiwashScreen.dryers');
352 359
         let remainingTime = 0;
353 360
         if (isMachineRunning)
354 361
             remainingTime = ProxiwashScreen.getRemainingTime(item.startTime, item.endTime, item.donePercent);
@@ -376,7 +383,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
376 383
                         backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor
377 384
                     }}/>
378 385
                     <PlatformTouchable
379
-                        onPress={() => this.showAlert(machineName, item, remainingTime)}
386
+                        onPress={() => this.showAlert(machineName, item, remainingTime, isDryer)}
380 387
                         style={{
381 388
                             height: 64,
382 389
                             position: 'absolute',
@@ -389,7 +396,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
389 396
                     </PlatformTouchable>
390 397
                     <Left style={{marginLeft: 10}}>
391 398
                         <CustomMaterialIcon
392
-                            icon={section.title === i18n.t('proxiwashScreen.dryers') ? 'tumble-dryer' : 'washing-machine'}
399
+                            icon={isDryer ? 'tumble-dryer' : 'washing-machine'}
393 400
                             fontSize={30}
394 401
                         />
395 402
                         <Body>

+ 0
- 1
screens/SelfMenuScreen.js View File

@@ -53,7 +53,6 @@ export default class SelfMenuScreen extends React.Component<Props> {
53 53
 
54 54
     render() {
55 55
         const nav = this.props.navigation;
56
-        console.log(this.customInjectedJS);
57 56
         return (
58 57
             <Container>
59 58
                 <CustomHeader navigation={nav} title={i18n.t('screens.menuSelf')} hasBackButton={true}

+ 23
- 4
translations/en.json View File

@@ -4,14 +4,14 @@
4 4
     "planning": "Planning",
5 5
     "proxiwash": "Proxiwash",
6 6
     "proximo": "Proximo",
7
-    "menuSelf": "UR Menu",
7
+    "menuSelf": "RU Menu",
8 8
     "settings": "Settings",
9 9
     "about": "About"
10 10
   },
11 11
   "intro": {
12 12
     "slide1": {
13 13
       "title": "Welcome to COFFEE",
14
-      "text": "The new app to use during your coffee break to get updates on the campus life!",
14
+      "text": "The new app to use during your coffee break to get updates on the campus life!"
15 15
     },
16 16
     "slide2": {
17 17
       "title": "Stay up to date",
@@ -82,7 +82,11 @@
82 82
     "listUpdateFail": "Error while updating article list",
83 83
     "loading": "Loading...",
84 84
     "listTitle": "Choose a category",
85
-    "inStock": "in stock"
85
+    "inStock": "in stock",
86
+    "description": "The Proximo is your small grocery store maintained by students directly on the campus. Open every day from 18h30 to 19h30, we welcome you when you are short on pastas or sodas ! Different products for different problems, everything at cost price. You can pay by Lydia or cash.",
87
+    "openingHours": "Openning Hours",
88
+    "paymentMethods" : "Payment Methods",
89
+    "paymentMethodsDescription" : "Cash or Lydia"
86 90
   },
87 91
   "proxiwashScreen": {
88 92
     "dryer": "Dryer",
@@ -94,13 +98,28 @@
94 98
     "listUpdateFail": "Error while updating machines state",
95 99
     "error": "Could not update machines state. Pull down to retry.",
96 100
     "loading": "Loading...",
101
+
102
+    "informationTab": "Information",
103
+    "paymentTab" : "Payment",
104
+    "tariffs": "Tariffs",
105
+    "washersTariff": "3€ the washer + 0.80€ with detergent.",
106
+    "dryersTariff": "0.35€ for 5min of dryer usage.",
107
+    "paymentMethods": "Payment Methods",
108
+    "paymentMethodsDescription" : "Cash up until 10€.\nCredit Card also accepted.",
109
+    "washerProcedure": "Put your laundry in the tumble without tamping it and by respecting charge limits.\n\nClose the machine's door.\n\nChoose a program using one of the four favorite program buttons.\n\nPay to the command central, then press the START button on the machine.\n\nWhen the program is finished, the screen indicates 'Programme terminé', press the yellow button to open the lid and retrieve your laundry.",
110
+    "washerTips": "Program 'blanc/couleur': 6kg of dry laundry (cotton linen, linen, underwear, sheets, jeans, towels).\n\nProgram 'non repassable': 3,5 kg of dry laundry (synthetic fibre linen, cotton and polyester mixed).\n\nProgram 'fin 30°C': 2,5 kg of dry laundry (delicate linen in synthetic fibres).\n\nProgram 'laine 30°C': 2,5 kg of dry laundry (wool textiles).",
111
+    "dryerProcedure": "Put your laundry in the tumble without tamping it and by respecting charge limits.\n\nClose the machine's door.\n\nChoose a program using one of the four favorite program buttons.\n\nPay to the command central, then press the START button on the machine.",
112
+    "dryerTips": "The advised dryer length is 35 minutes for 14 kg of laundry. You can choose a shorter length if the dryer is not fully charged.",
113
+    "procedure": "Procedure",
114
+    "tips": "Tips",
115
+
97 116
     "modal": {
98 117
       "enableNotifications": "Notify me",
99 118
       "disableNotifications": "Stop notifications",
100 119
       "ok": "OK",
101 120
       "cancel": "Cancel",
102 121
       "finished": "This machine is finished. If you started it, you can get back your laundry.",
103
-      "ready": "This machine is empty and ready to use. {Put price here}",
122
+      "ready": "This machine is empty and ready to use.",
104 123
       "running": "This machine has been started at %{start} and will end at %{end}.\nRemaining time: %{remaining} min",
105 124
       "broken": "This machine is broken and cannot be used. Thank you for your comprehension.",
106 125
       "error": "There has been an error and we are unable to get information from this machine. Sorry for the inconvenience."

+ 21
- 2
translations/fr.json View File

@@ -82,7 +82,11 @@
82 82
     "listUpdateFail": "Erreur lors de la mise à jour de la list d'articles",
83 83
     "loading": "Chargement...",
84 84
     "listTitle": "Choisissez une catégorie",
85
-    "inStock": "en stock"
85
+    "inStock": "en stock",
86
+    "description": "Le Proximo c’est ta petite épicerie étudiante tenu par les étudiants directement sur le campus. Ouvert tous les jours de 18h30 à 19h30, nous t’accueillons et te souvent quand tu n’as plus de pâtes ou de diluant ! Différents produits pour différentes galère, le tout à prix coûtant. Tu peux payer par Lydia ou par espèce.",
87
+    "openingHours": "Horaires d'ouverture",
88
+    "paymentMethods" : "Moyens de Paiement",
89
+    "paymentMethodsDescription" : "Espèce ou Lydia"
86 90
   },
87 91
   "proxiwashScreen": {
88 92
     "dryer": "Sèche Linge",
@@ -94,13 +98,28 @@
94 98
     "listUpdateFail": "Erreur lors de la mise à jour del'état des machines",
95 99
     "error": "Impossible de mettre a jour l'état des machines. Tirez vers le bas pour reessayer.",
96 100
     "loading": "Chargement...",
101
+
102
+    "informationTab": "Informations",
103
+    "paymentTab" : "Paiement",
104
+    "tariffs": "Tarifs",
105
+    "washersTariff": "3€ la machine + 0.80€ avec la lessive.",
106
+    "dryersTariff": "0.35€ pour 5min de sèche linge.",
107
+    "paymentMethods": "Moyens de Paiement",
108
+    "paymentMethodsDescription" : "Toute monnaie jusqu'à 10€.\nCarte bancaire acceptée.",
109
+    "washerProcedure": "Déposer le linge dans le tambour sans le tasser et en respectant les charges.\n\nFermer la porte de l'appareil.\n\nSélectionner un programme avec l'une des quatre touches de programme favori standard.\n\nAprès avoir payé à la centrale de commande, appuyer sur le bouton marqué START du lave-linge.\n\nDès que le programme est terminé, l’afficheur indique 'Programme terminé', appuyer sur le bouton jaune d’ouverture du hublot pour récupérer le linge.",
110
+    "washerTips": "Programme blanc/couleur : 6kg de linge sec (textiles en coton, lin, linge de corps, draps, jeans,serviettes de toilettes).\n\nProgramme nonrepassable : 3,5 kg de linge sec (textiles en fibres synthétiques, cotonet polyester mélangés).\n\nProgramme fin 30°C : 2,5 kg de linge sec (textiles délicats en fibres synthétiques, rayonne).\n\nProgramme laine 30°C : 2,5 kg de linge sec (textiles en laine et lainages lavables).",
111
+    "dryerProcedure": "Déposer le linge dans le tambour sans le tasser et en respectant les charges.\n\nFermer la porte de l'appareil.\n\nSélectionner un programme avec l'une des quatre touches de programme favori standard.\n\nAprès avoir payé à la centrale de commande, appuyer sur le bouton marqué START du lave-linge.",
112
+    "dryerTips": "La durée conseillée est de 35 minutes pour 14kg de linge. Vous pouvez choisir une durée plus courte si le seche-linge n'est pas chargé.",
113
+    "procedure": "Procédure",
114
+    "tips": "Conseils",
115
+
97 116
     "modal": {
98 117
       "enableNotifications": "Me Notifier",
99 118
       "disableNotifications": "Désactiver les  notifications",
100 119
       "ok": "OK",
101 120
       "cancel": "Annuler",
102 121
       "finished": "Cette machine est terminée. Si vous l'avez l'avez démarée, vous pouvez récupérer votre linge.",
103
-      "ready": "Cette machine est vide et prête à être utilisée. {Afficher prix ici}",
122
+      "ready": "Cette machine est vide et prête à être utilisée.",
104 123
       "running": "Cette machine a démarré à %{start} et terminera à %{end}.\nTemps restant : %{remaining} min",
105 124
       "broken": "Cette machine est hors service. Merci pour votre compréhension.",
106 125
       "error": "Il y a eu une erreur et il est impossible de récupérer les informations de cette machine. Veuillez nous excuser pour le gène occasionnée."

Loading…
Cancel
Save