Added more information in proxiwash about screen + added more translations

This commit is contained in:
keplyx 2019-08-09 10:54:05 +02:00
parent 206772c695
commit e83c3a834d
6 changed files with 106 additions and 44 deletions

View file

@ -43,17 +43,12 @@ export default class ProximoAboutScreen extends React.Component<Props> {
style={{flex: 1, resizeMode: "contain"}} style={{flex: 1, resizeMode: "contain"}}
resizeMode="contain"/> resizeMode="contain"/>
</View> </View>
<Text> <Text>{i18n.t('proximoScreen.description')}</Text>
Le Proximo cest ta petite épicerie étudiante tenu par les étudiants directement sur le
campus. Ouvert tous les jours de 18h30 à 19h30, nous taccueillons et te souvent quand tu nas
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.
</Text>
<Card> <Card>
<CardItem> <CardItem>
<Left> <Left>
<CustomMaterialIcon icon={'clock-outline'}/> <CustomMaterialIcon icon={'clock-outline'}/>
<H2>Horaires</H2> <H2>{i18n.t('proximoScreen.openingHours')}</H2>
</Left> </Left>
</CardItem> </CardItem>
<CardItem> <CardItem>
@ -64,11 +59,11 @@ export default class ProximoAboutScreen extends React.Component<Props> {
<CardItem> <CardItem>
<Left> <Left>
<CustomMaterialIcon icon={'cash'}/> <CustomMaterialIcon icon={'cash'}/>
<H2>Paiement</H2> <H2>{i18n.t('proximoScreen.paymentMethods')}</H2>
</Left> </Left>
</CardItem> </CardItem>
<CardItem> <CardItem>
<Text>Espèce ou Lydia</Text> <Text>{i18n.t('proximoScreen.paymentMethodsDescription')}</Text>
</CardItem> </CardItem>
</Card> </Card>
</Content> </Content>

View file

@ -2,7 +2,7 @@
import * as React from 'react'; import * as React from 'react';
import {Image, Linking, View} from 'react-native'; import {Image, Linking, View} from 'react-native';
import {Card, CardItem, Container, Content, H2, Left, Tab, TabHeading, Tabs, Text} from 'native-base'; import {Body, Card, CardItem, Container, Content, H2, H3, Left, Tab, TabHeading, Tabs, Text} from 'native-base';
import CustomHeader from "../components/CustomHeader"; import CustomHeader from "../components/CustomHeader";
import i18n from "i18n-js"; import i18n from "i18n-js";
import CustomMaterialIcon from "../components/CustomMaterialIcon"; import CustomMaterialIcon from "../components/CustomMaterialIcon";
@ -39,11 +39,12 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
color={'#fff'} color={'#fff'}
fontSize={20} fontSize={20}
/> />
<Text>Information</Text> <Text>{i18n.t('proxiwashScreen.informationTab')}</Text>
</TabHeading> </TabHeading>
} }
key={1} key={1}
style={{backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor}}> style={{backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor}}>
<Content padder>
<View style={{ <View style={{
width: '100%', width: '100%',
height: 100, height: 100,
@ -57,28 +58,45 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
style={{flex: 1, resizeMode: "contain"}} style={{flex: 1, resizeMode: "contain"}}
resizeMode="contain"/> resizeMode="contain"/>
</View> </View>
<Content padder>
<Text>Ta laverie directement sur le campus, au pied du R3.</Text> <Text>Ta laverie directement sur le campus, au pied du R3.</Text>
<Card> <Card>
<CardItem> <CardItem>
<Left> <Left>
<CustomMaterialIcon icon={'tumble-dryer'}/> <CustomMaterialIcon icon={'tumble-dryer'}/>
<H2>Seche linge</H2> <H2>{i18n.t('proxiwashScreen.dryer')}</H2>
</Left> </Left>
</CardItem> </CardItem>
<CardItem> <CardItem>
<Text>Coucou</Text> <Body>
<H3>{i18n.t('proxiwashScreen.procedure')}</H3>
<Text>{i18n.t('proxiwashScreen.dryerProcedure')}</Text>
</Body>
</CardItem>
<CardItem>
<Body>
<H3>{i18n.t('proxiwashScreen.tips')}</H3>
<Text>{i18n.t('proxiwashScreen.dryerTips')}</Text>
</Body>
</CardItem> </CardItem>
</Card> </Card>
<Card> <Card>
<CardItem> <CardItem>
<Left> <Left>
<CustomMaterialIcon icon={'washing-machine'}/> <CustomMaterialIcon icon={'washing-machine'}/>
<H2>Machine a laver</H2> <H2>{i18n.t('proxiwashScreen.washer')}</H2>
</Left> </Left>
</CardItem> </CardItem>
<CardItem> <CardItem>
<Text>Coucou</Text> <Body>
<H3>{i18n.t('proxiwashScreen.procedure')}</H3>
<Text>{i18n.t('proxiwashScreen.washerProcedure')}</Text>
</Body>
</CardItem>
<CardItem>
<Body>
<H3>{i18n.t('proxiwashScreen.tips')}</H3>
<Text>{i18n.t('proxiwashScreen.washerTips')}</Text>
</Body>
</CardItem> </CardItem>
</Card> </Card>
</Content> </Content>
@ -91,7 +109,7 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
color={'#fff'} color={'#fff'}
fontSize={20} fontSize={20}
/> />
<Text>Payment</Text> <Text>{i18n.t('proxiwashScreen.paymentTab')}</Text>
</TabHeading> </TabHeading>
} }
key={2} key={2}
@ -101,22 +119,27 @@ export default class ProxiwashAboutScreen extends React.Component<Props> {
<CardItem> <CardItem>
<Left> <Left>
<CustomMaterialIcon icon={'coins'}/> <CustomMaterialIcon icon={'coins'}/>
<H2>Tarifs</H2> <H2>{i18n.t('proxiwashScreen.tariffs')}</H2>
</Left> </Left>
</CardItem> </CardItem>
<CardItem> <CardItem>
<Text>Coucou</Text> <Body>
<Text>{i18n.t('proxiwashScreen.washersTariff')}</Text>
<Text>{i18n.t('proxiwashScreen.dryersTariff')}</Text>
</Body>
</CardItem> </CardItem>
</Card> </Card>
<Card> <Card>
<CardItem> <CardItem>
<Left> <Left>
<CustomMaterialIcon icon={'cash'}/> <CustomMaterialIcon icon={'cash'}/>
<H2>Moyens de Paiement</H2> <H2>{i18n.t('proxiwashScreen.paymentMethods')}</H2>
</Left> </Left>
</CardItem> </CardItem>
<CardItem> <CardItem>
<Text>Coucou</Text> <Body>
<Text>{i18n.t('proxiwashScreen.paymentMethodsDescription')}</Text>
</Body>
</CardItem> </CardItem>
</Card> </Card>
</Content> </Content>

View file

@ -9,9 +9,9 @@ import CustomMaterialIcon from "../components/CustomMaterialIcon";
import FetchedDataSectionList from "../components/FetchedDataSectionList"; import FetchedDataSectionList from "../components/FetchedDataSectionList";
import NotificationsManager from "../utils/NotificationsManager"; import NotificationsManager from "../utils/NotificationsManager";
import PlatformTouchable from "react-native-platform-touchable"; import PlatformTouchable from "react-native-platform-touchable";
import Touchable from "react-native-platform-touchable";
import AsyncStorageManager from "../utils/AsyncStorageManager"; import AsyncStorageManager from "../utils/AsyncStorageManager";
import * as Expo from "expo"; import * as Expo from "expo";
import Touchable from "react-native-platform-touchable";
const DATA_URL = "https://srv-falcon.etud.insa-toulouse.fr/~vergnet/appli-amicale/washinsa/washinsa.json"; const DATA_URL = "https://srv-falcon.etud.insa-toulouse.fr/~vergnet/appli-amicale/washinsa/washinsa.json";
@ -296,8 +296,9 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
* @param title * @param title
* @param item * @param item
* @param remainingTime * @param remainingTime
* @param isDryer
*/ */
showAlert(title: string, item: Object, remainingTime: number) { showAlert(title: string, item: Object, remainingTime: number, isDryer: boolean) {
let buttons = [{text: i18n.t("proxiwashScreen.modal.ok")}]; let buttons = [{text: i18n.t("proxiwashScreen.modal.ok")}];
let message = modalStateStrings[MACHINE_STATES[item.state]]; let message = modalStateStrings[MACHINE_STATES[item.state]];
if (MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"]) { if (MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"]) {
@ -318,6 +319,11 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
end: item.endTime, end: item.endTime,
remaining: remainingTime remaining: remainingTime
}); });
} else if (MACHINE_STATES[item.state] === MACHINE_STATES.DISPONIBLE) {
if (isDryer)
message += '\n' + i18n.t('proxiwashScreen.dryersTariff');
else
message += '\n' + i18n.t('proxiwashScreen.washersTariff');
} }
Alert.alert( Alert.alert(
title, title,
@ -349,6 +355,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
getRenderItem(item: Object, section: Object, data: Object) { getRenderItem(item: Object, section: Object, data: Object) {
let isMachineRunning = MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"]; let isMachineRunning = MACHINE_STATES[item.state] === MACHINE_STATES["EN COURS"];
let machineName = (section.title === i18n.t('proxiwashScreen.dryers') ? i18n.t('proxiwashScreen.dryer') : i18n.t('proxiwashScreen.washer')) + ' n°' + item.number; let machineName = (section.title === i18n.t('proxiwashScreen.dryers') ? i18n.t('proxiwashScreen.dryer') : i18n.t('proxiwashScreen.washer')) + ' n°' + item.number;
let isDryer = section.title === i18n.t('proxiwashScreen.dryers');
let remainingTime = 0; let remainingTime = 0;
if (isMachineRunning) if (isMachineRunning)
remainingTime = ProxiwashScreen.getRemainingTime(item.startTime, item.endTime, item.donePercent); remainingTime = ProxiwashScreen.getRemainingTime(item.startTime, item.endTime, item.donePercent);
@ -376,7 +383,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor backgroundColor: ThemeManager.getCurrentThemeVariables().containerBgColor
}}/> }}/>
<PlatformTouchable <PlatformTouchable
onPress={() => this.showAlert(machineName, item, remainingTime)} onPress={() => this.showAlert(machineName, item, remainingTime, isDryer)}
style={{ style={{
height: 64, height: 64,
position: 'absolute', position: 'absolute',
@ -389,7 +396,7 @@ export default class ProxiwashScreen extends FetchedDataSectionList {
</PlatformTouchable> </PlatformTouchable>
<Left style={{marginLeft: 10}}> <Left style={{marginLeft: 10}}>
<CustomMaterialIcon <CustomMaterialIcon
icon={section.title === i18n.t('proxiwashScreen.dryers') ? 'tumble-dryer' : 'washing-machine'} icon={isDryer ? 'tumble-dryer' : 'washing-machine'}
fontSize={30} fontSize={30}
/> />
<Body> <Body>

View file

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

View file

@ -4,14 +4,14 @@
"planning": "Planning", "planning": "Planning",
"proxiwash": "Proxiwash", "proxiwash": "Proxiwash",
"proximo": "Proximo", "proximo": "Proximo",
"menuSelf": "UR Menu", "menuSelf": "RU Menu",
"settings": "Settings", "settings": "Settings",
"about": "About" "about": "About"
}, },
"intro": { "intro": {
"slide1": { "slide1": {
"title": "Welcome to COFFEE", "title": "Welcome to COFFEE",
"text": "The new app to use during your coffee break to get updates on the campus life!", "text": "The new app to use during your coffee break to get updates on the campus life!"
}, },
"slide2": { "slide2": {
"title": "Stay up to date", "title": "Stay up to date",
@ -82,7 +82,11 @@
"listUpdateFail": "Error while updating article list", "listUpdateFail": "Error while updating article list",
"loading": "Loading...", "loading": "Loading...",
"listTitle": "Choose a category", "listTitle": "Choose a category",
"inStock": "in stock" "inStock": "in stock",
"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.",
"openingHours": "Openning Hours",
"paymentMethods" : "Payment Methods",
"paymentMethodsDescription" : "Cash or Lydia"
}, },
"proxiwashScreen": { "proxiwashScreen": {
"dryer": "Dryer", "dryer": "Dryer",
@ -94,13 +98,28 @@
"listUpdateFail": "Error while updating machines state", "listUpdateFail": "Error while updating machines state",
"error": "Could not update machines state. Pull down to retry.", "error": "Could not update machines state. Pull down to retry.",
"loading": "Loading...", "loading": "Loading...",
"informationTab": "Information",
"paymentTab" : "Payment",
"tariffs": "Tariffs",
"washersTariff": "3€ the washer + 0.80€ with detergent.",
"dryersTariff": "0.35€ for 5min of dryer usage.",
"paymentMethods": "Payment Methods",
"paymentMethodsDescription" : "Cash up until 10€.\nCredit Card also accepted.",
"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.",
"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).",
"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.",
"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.",
"procedure": "Procedure",
"tips": "Tips",
"modal": { "modal": {
"enableNotifications": "Notify me", "enableNotifications": "Notify me",
"disableNotifications": "Stop notifications", "disableNotifications": "Stop notifications",
"ok": "OK", "ok": "OK",
"cancel": "Cancel", "cancel": "Cancel",
"finished": "This machine is finished. If you started it, you can get back your laundry.", "finished": "This machine is finished. If you started it, you can get back your laundry.",
"ready": "This machine is empty and ready to use. {Put price here}", "ready": "This machine is empty and ready to use.",
"running": "This machine has been started at %{start} and will end at %{end}.\nRemaining time: %{remaining} min", "running": "This machine has been started at %{start} and will end at %{end}.\nRemaining time: %{remaining} min",
"broken": "This machine is broken and cannot be used. Thank you for your comprehension.", "broken": "This machine is broken and cannot be used. Thank you for your comprehension.",
"error": "There has been an error and we are unable to get information from this machine. Sorry for the inconvenience." "error": "There has been an error and we are unable to get information from this machine. Sorry for the inconvenience."

View file

@ -82,7 +82,11 @@
"listUpdateFail": "Erreur lors de la mise à jour de la list d'articles", "listUpdateFail": "Erreur lors de la mise à jour de la list d'articles",
"loading": "Chargement...", "loading": "Chargement...",
"listTitle": "Choisissez une catégorie", "listTitle": "Choisissez une catégorie",
"inStock": "en stock" "inStock": "en stock",
"description": "Le Proximo cest ta petite épicerie étudiante tenu par les étudiants directement sur le campus. Ouvert tous les jours de 18h30 à 19h30, nous taccueillons et te souvent quand tu nas 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.",
"openingHours": "Horaires d'ouverture",
"paymentMethods" : "Moyens de Paiement",
"paymentMethodsDescription" : "Espèce ou Lydia"
}, },
"proxiwashScreen": { "proxiwashScreen": {
"dryer": "Sèche Linge", "dryer": "Sèche Linge",
@ -94,13 +98,28 @@
"listUpdateFail": "Erreur lors de la mise à jour del'état des machines", "listUpdateFail": "Erreur lors de la mise à jour del'état des machines",
"error": "Impossible de mettre a jour l'état des machines. Tirez vers le bas pour reessayer.", "error": "Impossible de mettre a jour l'état des machines. Tirez vers le bas pour reessayer.",
"loading": "Chargement...", "loading": "Chargement...",
"informationTab": "Informations",
"paymentTab" : "Paiement",
"tariffs": "Tarifs",
"washersTariff": "3€ la machine + 0.80€ avec la lessive.",
"dryersTariff": "0.35€ pour 5min de sèche linge.",
"paymentMethods": "Moyens de Paiement",
"paymentMethodsDescription" : "Toute monnaie jusqu'à 10€.\nCarte bancaire acceptée.",
"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é, lafficheur indique 'Programme terminé', appuyer sur le bouton jaune douverture du hublot pour récupérer le linge.",
"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).",
"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.",
"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é.",
"procedure": "Procédure",
"tips": "Conseils",
"modal": { "modal": {
"enableNotifications": "Me Notifier", "enableNotifications": "Me Notifier",
"disableNotifications": "Désactiver les notifications", "disableNotifications": "Désactiver les notifications",
"ok": "OK", "ok": "OK",
"cancel": "Annuler", "cancel": "Annuler",
"finished": "Cette machine est terminée. Si vous l'avez l'avez démarée, vous pouvez récupérer votre linge.", "finished": "Cette machine est terminée. Si vous l'avez l'avez démarée, vous pouvez récupérer votre linge.",
"ready": "Cette machine est vide et prête à être utilisée. {Afficher prix ici}", "ready": "Cette machine est vide et prête à être utilisée.",
"running": "Cette machine a démarré à %{start} et terminera à %{end}.\nTemps restant : %{remaining} min", "running": "Cette machine a démarré à %{start} et terminera à %{end}.\nTemps restant : %{remaining} min",
"broken": "Cette machine est hors service. Merci pour votre compréhension.", "broken": "Cette machine est hors service. Merci pour votre compréhension.",
"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." "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."