forked from vergnet/application-amicale
updated translations
This commit is contained in:
parent
9fc3620044
commit
48fdca72c0
10 changed files with 114 additions and 39 deletions
|
@ -3,6 +3,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Avatar, Card, List, ProgressBar, Subheading, withTheme} from "react-native-paper";
|
import {Avatar, Card, List, ProgressBar, Subheading, withTheme} from "react-native-paper";
|
||||||
import {FlatList, StyleSheet} from "react-native";
|
import {FlatList, StyleSheet} from "react-native";
|
||||||
|
import i18n from 'i18n-js';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
teams: Array<Object>,
|
teams: Array<Object>,
|
||||||
|
@ -51,7 +52,7 @@ class VoteResults extends React.Component<Props> {
|
||||||
}}>
|
}}>
|
||||||
<List.Item
|
<List.Item
|
||||||
title={item.name}
|
title={item.name}
|
||||||
description={item.votes + " VOTES"}
|
description={item.votes + ' ' + i18n.t('voteScreen.results.votes')}
|
||||||
left={props => isWinner
|
left={props => isWinner
|
||||||
? <List.Icon {...props} icon="trophy" color={this.colors.primary}/>
|
? <List.Icon {...props} icon="trophy" color={this.colors.primary}/>
|
||||||
: null}
|
: null}
|
||||||
|
@ -71,15 +72,15 @@ class VoteResults extends React.Component<Props> {
|
||||||
return (
|
return (
|
||||||
<Card style={styles.card}>
|
<Card style={styles.card}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={"RESULTS"}
|
title={i18n.t('voteScreen.results.title')}
|
||||||
subtitle={"AVAILABLE UNTIL " + this.props.dateEnd}
|
subtitle={i18n.t('voteScreen.results.subtitle') + ' ' + this.props.dateEnd}
|
||||||
left={(props) => <Avatar.Icon
|
left={(props) => <Avatar.Icon
|
||||||
{...props}
|
{...props}
|
||||||
icon={"podium-gold"}
|
icon={"podium-gold"}
|
||||||
/>}
|
/>}
|
||||||
/>
|
/>
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Subheading>TOTAL VOTES : {this.totalVotes}</Subheading>
|
<Subheading>{i18n.t('voteScreen.results.totalVotes') + ' ' +this.totalVotes}</Subheading>
|
||||||
{/*$FlowFixMe*/}
|
{/*$FlowFixMe*/}
|
||||||
<FlatList
|
<FlatList
|
||||||
data={this.props.teams}
|
data={this.props.teams}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {FlatList, StyleSheet, View} from "react-native";
|
||||||
import ConnectionManager from "../../../managers/ConnectionManager";
|
import ConnectionManager from "../../../managers/ConnectionManager";
|
||||||
import LoadingConfirmDialog from "../../Dialog/LoadingConfirmDialog";
|
import LoadingConfirmDialog from "../../Dialog/LoadingConfirmDialog";
|
||||||
import ErrorDialog from "../../Dialog/ErrorDialog";
|
import ErrorDialog from "../../Dialog/ErrorDialog";
|
||||||
|
import i18n from 'i18n-js';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
teams: Array<Object>,
|
teams: Array<Object>,
|
||||||
|
@ -74,8 +75,8 @@ export default class VoteSelect extends React.PureComponent<Props, State> {
|
||||||
<View>
|
<View>
|
||||||
<Card style={styles.card}>
|
<Card style={styles.card}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={"VOTE OPEN"}
|
title={i18n.t('voteScreen.select.title')}
|
||||||
subtitle={"VOTE NOW"}
|
subtitle={i18n.t('voteScreen.select.subtitle')}
|
||||||
left={(props) => <Avatar.Icon
|
left={(props) => <Avatar.Icon
|
||||||
{...props}
|
{...props}
|
||||||
icon={"alert-decagram"}
|
icon={"alert-decagram"}
|
||||||
|
@ -103,7 +104,7 @@ export default class VoteSelect extends React.PureComponent<Props, State> {
|
||||||
style={{marginLeft: 'auto'}}
|
style={{marginLeft: 'auto'}}
|
||||||
disabled={this.state.selectedTeam === "none"}
|
disabled={this.state.selectedTeam === "none"}
|
||||||
>
|
>
|
||||||
SEND VOTE
|
{i18n.t('voteScreen.select.sendButton')}
|
||||||
</Button>
|
</Button>
|
||||||
</Card.Actions>
|
</Card.Actions>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -111,9 +112,9 @@ export default class VoteSelect extends React.PureComponent<Props, State> {
|
||||||
visible={this.state.voteDialogVisible}
|
visible={this.state.voteDialogVisible}
|
||||||
onDismiss={this.onVoteDialogDismiss}
|
onDismiss={this.onVoteDialogDismiss}
|
||||||
onAccept={this.onVoteDialogAccept}
|
onAccept={this.onVoteDialogAccept}
|
||||||
title={"VOTE?"}
|
title={i18n.t('voteScreen.select.dialogTitle')}
|
||||||
titleLoading={"SENDING VOTE..."}
|
titleLoading={i18n.t('voteScreen.select.dialogTitleLoading')}
|
||||||
message={"SURE?"}
|
message={i18n.t('voteScreen.select.dialogMessage')}
|
||||||
/>
|
/>
|
||||||
<ErrorDialog
|
<ErrorDialog
|
||||||
visible={this.state.errorDialogVisible}
|
visible={this.state.errorDialogVisible}
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Avatar, Card, Paragraph} from "react-native-paper";
|
import {Avatar, Card, Paragraph} from "react-native-paper";
|
||||||
import {StyleSheet} from "react-native";
|
import {StyleSheet} from "react-native";
|
||||||
|
import i18n from 'i18n-js';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
startDate: string,
|
startDate: string,
|
||||||
|
@ -18,16 +19,15 @@ export default class VoteTease extends React.Component<Props> {
|
||||||
return (
|
return (
|
||||||
<Card style={styles.card}>
|
<Card style={styles.card}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={"VOTE INCOMING"}
|
title={i18n.t('voteScreen.tease.title')}
|
||||||
subtitle={"GET READY"}
|
subtitle={i18n.t('voteScreen.tease.subtitle')}
|
||||||
left={props => <Avatar.Icon
|
left={props => <Avatar.Icon
|
||||||
{...props}
|
{...props}
|
||||||
icon="vote"/>}
|
icon="vote"/>}
|
||||||
/>
|
/>
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
VOTE STARTS
|
{i18n.t('voteScreen.tease.message') + ' ' + this.props.startDate}
|
||||||
AT {this.props.startDate}
|
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Avatar, Card, Paragraph} from "react-native-paper";
|
import {Avatar, Card, Paragraph} from "react-native-paper";
|
||||||
import {StyleSheet} from "react-native";
|
import {StyleSheet} from "react-native";
|
||||||
|
import i18n from 'i18n-js';
|
||||||
|
|
||||||
const ICON_AMICALE = require('../../../../assets/amicale.png');
|
const ICON_AMICALE = require('../../../../assets/amicale.png');
|
||||||
|
|
||||||
|
@ -18,8 +19,8 @@ export default class VoteTitle extends React.Component<Props> {
|
||||||
return (
|
return (
|
||||||
<Card style={styles.card}>
|
<Card style={styles.card}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={"VOTE"}
|
title={i18n.t('voteScreen.title.title')}
|
||||||
subtitle={"WHY"}
|
subtitle={i18n.t('voteScreen.title.subtitle')}
|
||||||
left={(props) => <Avatar.Image
|
left={(props) => <Avatar.Image
|
||||||
{...props}
|
{...props}
|
||||||
source={ICON_AMICALE}
|
source={ICON_AMICALE}
|
||||||
|
@ -28,15 +29,10 @@ export default class VoteTitle extends React.Component<Props> {
|
||||||
/>
|
/>
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rhoncus porttitor
|
{i18n.t('voteScreen.title.paragraph1')}
|
||||||
suscipit. Quisque hendrerit, quam id vestibulum vestibulum, lorem nisi hendrerit nisi, a
|
|
||||||
eleifend sapien diam ut elit. Curabitur sit amet vulputate lectus. Donec semper cursus sapien
|
|
||||||
vel finibus.
|
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
Sed et venenatis turpis. Fusce malesuada magna urna, sed vehicula sem luctus in. Vivamus
|
{i18n.t('voteScreen.title.paragraph2')}
|
||||||
faucibus vel eros a ultricies. In sed laoreet ante, luctus mattis tellus. Etiam vitae ipsum
|
|
||||||
sagittis, consequat purus sed, blandit risus.
|
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {ActivityIndicator, Card, Paragraph, withTheme} from "react-native-paper";
|
import {ActivityIndicator, Card, Paragraph, withTheme} from "react-native-paper";
|
||||||
import {StyleSheet} from "react-native";
|
import {StyleSheet} from "react-native";
|
||||||
|
import i18n from 'i18n-js';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
startDate: string | null,
|
startDate: string | null,
|
||||||
|
@ -28,32 +29,33 @@ class VoteWait extends React.Component<Props> {
|
||||||
return (
|
return (
|
||||||
<Card style={styles.card}>
|
<Card style={styles.card}>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={this.props.isVoteRunning ? "VOTE SUBMITTED" : "VOTES HAVE ENDED"}
|
title={this.props.isVoteRunning
|
||||||
subtitle={"WAITING FOR RESULTS"}
|
? i18n.t('voteScreen.wait.titleSubmitted')
|
||||||
|
: i18n.t('voteScreen.wait.titleEnded')}
|
||||||
|
subtitle={i18n.t('voteScreen.wait.subtitle')}
|
||||||
left={(props) => <ActivityIndicator {...props}/>}
|
left={(props) => <ActivityIndicator {...props}/>}
|
||||||
/>
|
/>
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
{
|
{
|
||||||
this.props.justVoted
|
this.props.justVoted
|
||||||
? <Paragraph style={{color: this.colors.success}}>
|
? <Paragraph style={{color: this.colors.success}}>
|
||||||
VOTE SUBMITTED. THX FOR YOUR PARTICIPATION
|
{i18n.t('voteScreen.wait.messageSubmitted')}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
this.props.hasVoted
|
this.props.hasVoted
|
||||||
? <Paragraph style={{color: this.colors.success}}>
|
? <Paragraph style={{color: this.colors.success}}>
|
||||||
THX FOR THE VOTE
|
{i18n.t('voteScreen.wait.messageVoted')}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
: null
|
: null
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
this.props.startDate !== null
|
this.props.startDate !== null
|
||||||
? <Paragraph>
|
? <Paragraph>
|
||||||
RESULTS AVAILABLE
|
{i18n.t('voteScreen.wait.messageDate') + ' ' + this.props.startDate}
|
||||||
AT {this.props.startDate}
|
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
: <Paragraph>RESULTS AVAILABLE SHORTLY</Paragraph>
|
: <Paragraph>{i18n.t('voteScreen.wait.messageDateUndefined')}</Paragraph>
|
||||||
}
|
}
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
|
@ -70,7 +70,7 @@ class SideBar extends React.Component<Props, State> {
|
||||||
onlyWhenLoggedIn: true,
|
onlyWhenLoggedIn: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "VOTE",
|
name: i18n.t('screens.vote'),
|
||||||
route: "VoteScreen",
|
route: "VoteScreen",
|
||||||
icon: "vote",
|
icon: "vote",
|
||||||
onlyWhenLoggedIn: true,
|
onlyWhenLoggedIn: true,
|
||||||
|
|
|
@ -256,7 +256,7 @@ function VoteStackComponent() {
|
||||||
options={({navigation}) => {
|
options={({navigation}) => {
|
||||||
const openDrawer = getDrawerButton.bind(this, navigation);
|
const openDrawer = getDrawerButton.bind(this, navigation);
|
||||||
return {
|
return {
|
||||||
title: "VoteScreen",
|
title: i18n.t('screens.vote'),
|
||||||
headerLeft: openDrawer
|
headerLeft: openDrawer
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -11,9 +11,9 @@ import VoteResults from "../../components/Amicale/Vote/VoteResults";
|
||||||
import VoteWait from "../../components/Amicale/Vote/VoteWait";
|
import VoteWait from "../../components/Amicale/Vote/VoteWait";
|
||||||
|
|
||||||
const FAKE_DATE = {
|
const FAKE_DATE = {
|
||||||
"date_begin": "2020-04-06 21:50",
|
"date_begin": "2020-04-07 21:50",
|
||||||
"date_end": "2020-04-07 23:50",
|
"date_end": "2020-04-06 23:50",
|
||||||
"date_result_begin": "2020-04-07 21:50",
|
"date_result_begin": "2020-04-06 21:50",
|
||||||
"date_result_end": "2020-04-07 22:50",
|
"date_result_end": "2020-04-07 22:50",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -201,7 +201,8 @@ export default class VoteScreen extends React.Component<Props, State> {
|
||||||
let startDate = null;
|
let startDate = null;
|
||||||
if (this.dates.date_result_begin !== null)
|
if (this.dates.date_result_begin !== null)
|
||||||
startDate = this.getDateString(this.dates.date_result_begin, this.datesString.date_result_begin);
|
startDate = this.getDateString(this.dates.date_result_begin, this.datesString.date_result_begin);
|
||||||
return <VoteWait startDate={startDate} hasVoted={this.hasVoted} justVoted={this.state.hasVoted}
|
return <VoteWait startDate={startDate} hasVoted={this.hasVoted || this.state.hasVoted}
|
||||||
|
justVoted={this.state.hasVoted}
|
||||||
isVoteRunning={this.isVoteRunning()}/>;
|
isVoteRunning={this.isVoteRunning()}/>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
"debug": "Debug",
|
"debug": "Debug",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"logout": "Logout",
|
"logout": "Logout",
|
||||||
"profile": "Profile"
|
"profile": "Profile",
|
||||||
|
"vote": "Elections"
|
||||||
},
|
},
|
||||||
"sidenav": {
|
"sidenav": {
|
||||||
"divider1": "Student websites",
|
"divider1": "Student websites",
|
||||||
|
@ -236,7 +237,7 @@
|
||||||
"whyAccountSub": "What can you do wth an account",
|
"whyAccountSub": "What can you do wth an account",
|
||||||
"whyAccountParagraph": "An Amicale account allows you to take part in several activities around campus. You can join a club, or even create your own!",
|
"whyAccountParagraph": "An Amicale account allows you to take part in several activities around campus. You can join a club, or even create your own!",
|
||||||
"whyAccountParagraph2": "Logging into your Amicale account on the app will allow you to see all available clubs on the campus, vote for the upcoming elections, and more to come!",
|
"whyAccountParagraph2": "Logging into your Amicale account on the app will allow you to see all available clubs on the campus, vote for the upcoming elections, and more to come!",
|
||||||
"noAccount": "No Account? Go to the Amicale's building during open hours to create one.",
|
"noAccount": "No Account? Go to the Amicale's building during open hours to create one."
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"title": "Error!",
|
"title": "Error!",
|
||||||
|
@ -257,6 +258,42 @@
|
||||||
"categories": "Categories",
|
"categories": "Categories",
|
||||||
"categoriesFilterMessage": "Click on a category to filter the list"
|
"categoriesFilterMessage": "Click on a category to filter the list"
|
||||||
},
|
},
|
||||||
|
"voteScreen": {
|
||||||
|
"select": {
|
||||||
|
"title": "Elections open",
|
||||||
|
"subtitle": "Vote now!",
|
||||||
|
"sendButton": "Send Vote",
|
||||||
|
"dialogTitle": "Send Vote?",
|
||||||
|
"dialogTitleLoading": "Sending vote...",
|
||||||
|
"dialogMessage": "Are you sure you want to send your vote? You will not be able to change it."
|
||||||
|
},
|
||||||
|
"tease": {
|
||||||
|
"title": "Elections incoming",
|
||||||
|
"subtitle": "Be ready to vote!",
|
||||||
|
"message" : "Vote start:"
|
||||||
|
},
|
||||||
|
"wait": {
|
||||||
|
"titleSubmitted": "Vote submitted!",
|
||||||
|
"titleEnded": "Votes closed",
|
||||||
|
"subtitle" : "Waiting for results...",
|
||||||
|
"messageSubmitted" : "Vote submitted successfully.",
|
||||||
|
"messageVoted" : "Thank you for your participation.",
|
||||||
|
"messageDate" : "Results available:",
|
||||||
|
"messageDateUndefined" : "Results will be available shortly"
|
||||||
|
},
|
||||||
|
"results": {
|
||||||
|
"title": "Results",
|
||||||
|
"subtitle": "Available until:",
|
||||||
|
"totalVotes" : "Total votes:",
|
||||||
|
"votes" : "votes"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"title": "The Elections",
|
||||||
|
"subtitle": "Why your vote is important",
|
||||||
|
"paragraph1" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rhoncus porttitor suscipit. Quisque hendrerit, quam id vestibulum vestibulum, lorem nisi hendrerit nisi, a eleifend sapien diam ut elit. Curabitur sit amet vulputate lectus. Donec semper cursus sapienvel finibus.",
|
||||||
|
"paragraph2" : "Sed et venenatis turpis. Fusce malesuada magna urna, sed vehicula sem luctus in. Vivamus faucibus vel eros a ultricies. In sed laoreet ante, luctus mattis tellus. Etiam vitae ipsum sagittis, consequat purus sed, blandit risus."
|
||||||
|
}
|
||||||
|
},
|
||||||
"dialog": {
|
"dialog": {
|
||||||
"ok": "OK",
|
"ok": "OK",
|
||||||
"yes": "Yes",
|
"yes": "Yes",
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
"debug": "Debug",
|
"debug": "Debug",
|
||||||
"login": "Se Connecter",
|
"login": "Se Connecter",
|
||||||
"logout": "Se Déconnecter",
|
"logout": "Se Déconnecter",
|
||||||
"profile": "Profil"
|
"profile": "Profil",
|
||||||
|
"vote": "Élections"
|
||||||
},
|
},
|
||||||
"sidenav": {
|
"sidenav": {
|
||||||
"divider1": "Sites étudiants",
|
"divider1": "Sites étudiants",
|
||||||
|
@ -257,6 +258,42 @@
|
||||||
"categories": "Catégories",
|
"categories": "Catégories",
|
||||||
"categoriesFilterMessage": "Cliquez sur une catégorie pour filtrer la liste"
|
"categoriesFilterMessage": "Cliquez sur une catégorie pour filtrer la liste"
|
||||||
},
|
},
|
||||||
|
"voteScreen": {
|
||||||
|
"select": {
|
||||||
|
"title": "Élections ouvertes",
|
||||||
|
"subtitle": "Votez maintenant !",
|
||||||
|
"sendButton": "Envoyer votre vote",
|
||||||
|
"dialogTitle": "Envoyer votre vote ?",
|
||||||
|
"dialogTitleLoading": "Envoi du vote...",
|
||||||
|
"dialogMessage": "Êtes vous sûr de vouloir envoyer votre vote ? Vous ne pourrez plus le changer."
|
||||||
|
},
|
||||||
|
"tease": {
|
||||||
|
"title": "Les élections arrivent",
|
||||||
|
"subtitle": "Préparez vous à voter !",
|
||||||
|
"message" : "Début des votes :"
|
||||||
|
},
|
||||||
|
"wait": {
|
||||||
|
"titleSubmitted": "Vote envoyé !",
|
||||||
|
"titleEnded": "Votes fermés",
|
||||||
|
"subtitle" : "Attente des résultats...",
|
||||||
|
"messageSubmitted" : "Votre vote a bien été envoyé.",
|
||||||
|
"messageVoted" : "Merci pour votre participation.",
|
||||||
|
"messageDate" : "Disponibilité des résultats :",
|
||||||
|
"messageDateUndefined" : "les résultats seront disponibles sous peu."
|
||||||
|
},
|
||||||
|
"results": {
|
||||||
|
"title": "Résultats",
|
||||||
|
"subtitle": "Disponibles jusqu'à :",
|
||||||
|
"totalVotes" : "Nombre total de votes :",
|
||||||
|
"votes" : "votes"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"title": "Les Élections",
|
||||||
|
"subtitle": "Pourquoi votre vote est important",
|
||||||
|
"paragraph1" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rhoncus porttitor suscipit. Quisque hendrerit, quam id vestibulum vestibulum, lorem nisi hendrerit nisi, a eleifend sapien diam ut elit. Curabitur sit amet vulputate lectus. Donec semper cursus sapienvel finibus.",
|
||||||
|
"paragraph2" : "Sed et venenatis turpis. Fusce malesuada magna urna, sed vehicula sem luctus in. Vivamus faucibus vel eros a ultricies. In sed laoreet ante, luctus mattis tellus. Etiam vitae ipsum sagittis, consequat purus sed, blandit risus."
|
||||||
|
}
|
||||||
|
},
|
||||||
"dialog": {
|
"dialog": {
|
||||||
"ok": "OK",
|
"ok": "OK",
|
||||||
"yes": "Oui",
|
"yes": "Oui",
|
||||||
|
|
Loading…
Reference in a new issue