updated translations

This commit is contained in:
Arnaud Vergnet 2020-04-07 16:09:39 +02:00
parent 9fc3620044
commit 48fdca72c0
10 changed files with 114 additions and 39 deletions

View file

@ -3,6 +3,7 @@
import * as React from 'react';
import {Avatar, Card, List, ProgressBar, Subheading, withTheme} from "react-native-paper";
import {FlatList, StyleSheet} from "react-native";
import i18n from 'i18n-js';
type Props = {
teams: Array<Object>,
@ -51,7 +52,7 @@ class VoteResults extends React.Component<Props> {
}}>
<List.Item
title={item.name}
description={item.votes + " VOTES"}
description={item.votes + ' ' + i18n.t('voteScreen.results.votes')}
left={props => isWinner
? <List.Icon {...props} icon="trophy" color={this.colors.primary}/>
: null}
@ -71,15 +72,15 @@ class VoteResults extends React.Component<Props> {
return (
<Card style={styles.card}>
<Card.Title
title={"RESULTS"}
subtitle={"AVAILABLE UNTIL " + this.props.dateEnd}
title={i18n.t('voteScreen.results.title')}
subtitle={i18n.t('voteScreen.results.subtitle') + ' ' + this.props.dateEnd}
left={(props) => <Avatar.Icon
{...props}
icon={"podium-gold"}
/>}
/>
<Card.Content>
<Subheading>TOTAL VOTES : {this.totalVotes}</Subheading>
<Subheading>{i18n.t('voteScreen.results.totalVotes') + ' ' +this.totalVotes}</Subheading>
{/*$FlowFixMe*/}
<FlatList
data={this.props.teams}

View file

@ -6,6 +6,7 @@ import {FlatList, StyleSheet, View} from "react-native";
import ConnectionManager from "../../../managers/ConnectionManager";
import LoadingConfirmDialog from "../../Dialog/LoadingConfirmDialog";
import ErrorDialog from "../../Dialog/ErrorDialog";
import i18n from 'i18n-js';
type Props = {
teams: Array<Object>,
@ -74,8 +75,8 @@ export default class VoteSelect extends React.PureComponent<Props, State> {
<View>
<Card style={styles.card}>
<Card.Title
title={"VOTE OPEN"}
subtitle={"VOTE NOW"}
title={i18n.t('voteScreen.select.title')}
subtitle={i18n.t('voteScreen.select.subtitle')}
left={(props) => <Avatar.Icon
{...props}
icon={"alert-decagram"}
@ -103,7 +104,7 @@ export default class VoteSelect extends React.PureComponent<Props, State> {
style={{marginLeft: 'auto'}}
disabled={this.state.selectedTeam === "none"}
>
SEND VOTE
{i18n.t('voteScreen.select.sendButton')}
</Button>
</Card.Actions>
</Card>
@ -111,9 +112,9 @@ export default class VoteSelect extends React.PureComponent<Props, State> {
visible={this.state.voteDialogVisible}
onDismiss={this.onVoteDialogDismiss}
onAccept={this.onVoteDialogAccept}
title={"VOTE?"}
titleLoading={"SENDING VOTE..."}
message={"SURE?"}
title={i18n.t('voteScreen.select.dialogTitle')}
titleLoading={i18n.t('voteScreen.select.dialogTitleLoading')}
message={i18n.t('voteScreen.select.dialogMessage')}
/>
<ErrorDialog
visible={this.state.errorDialogVisible}

View file

@ -3,6 +3,7 @@
import * as React from 'react';
import {Avatar, Card, Paragraph} from "react-native-paper";
import {StyleSheet} from "react-native";
import i18n from 'i18n-js';
type Props = {
startDate: string,
@ -18,16 +19,15 @@ export default class VoteTease extends React.Component<Props> {
return (
<Card style={styles.card}>
<Card.Title
title={"VOTE INCOMING"}
subtitle={"GET READY"}
title={i18n.t('voteScreen.tease.title')}
subtitle={i18n.t('voteScreen.tease.subtitle')}
left={props => <Avatar.Icon
{...props}
icon="vote"/>}
/>
<Card.Content>
<Paragraph>
VOTE STARTS
AT {this.props.startDate}
{i18n.t('voteScreen.tease.message') + ' ' + this.props.startDate}
</Paragraph>
</Card.Content>
</Card>

View file

@ -3,6 +3,7 @@
import * as React from 'react';
import {Avatar, Card, Paragraph} from "react-native-paper";
import {StyleSheet} from "react-native";
import i18n from 'i18n-js';
const ICON_AMICALE = require('../../../../assets/amicale.png');
@ -18,8 +19,8 @@ export default class VoteTitle extends React.Component<Props> {
return (
<Card style={styles.card}>
<Card.Title
title={"VOTE"}
subtitle={"WHY"}
title={i18n.t('voteScreen.title.title')}
subtitle={i18n.t('voteScreen.title.subtitle')}
left={(props) => <Avatar.Image
{...props}
source={ICON_AMICALE}
@ -28,15 +29,10 @@ export default class VoteTitle extends React.Component<Props> {
/>
<Card.Content>
<Paragraph>
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 sapien
vel finibus.
{i18n.t('voteScreen.title.paragraph1')}
</Paragraph>
<Paragraph>
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.
{i18n.t('voteScreen.title.paragraph2')}
</Paragraph>
</Card.Content>
</Card>

View file

@ -3,6 +3,7 @@
import * as React from 'react';
import {ActivityIndicator, Card, Paragraph, withTheme} from "react-native-paper";
import {StyleSheet} from "react-native";
import i18n from 'i18n-js';
type Props = {
startDate: string | null,
@ -28,32 +29,33 @@ class VoteWait extends React.Component<Props> {
return (
<Card style={styles.card}>
<Card.Title
title={this.props.isVoteRunning ? "VOTE SUBMITTED" : "VOTES HAVE ENDED"}
subtitle={"WAITING FOR RESULTS"}
title={this.props.isVoteRunning
? i18n.t('voteScreen.wait.titleSubmitted')
: i18n.t('voteScreen.wait.titleEnded')}
subtitle={i18n.t('voteScreen.wait.subtitle')}
left={(props) => <ActivityIndicator {...props}/>}
/>
<Card.Content>
{
this.props.justVoted
? <Paragraph style={{color: this.colors.success}}>
VOTE SUBMITTED. THX FOR YOUR PARTICIPATION
{i18n.t('voteScreen.wait.messageSubmitted')}
</Paragraph>
: null
}
{
this.props.hasVoted
? <Paragraph style={{color: this.colors.success}}>
THX FOR THE VOTE
{i18n.t('voteScreen.wait.messageVoted')}
</Paragraph>
: null
}
{
this.props.startDate !== null
? <Paragraph>
RESULTS AVAILABLE
AT {this.props.startDate}
{i18n.t('voteScreen.wait.messageDate') + ' ' + this.props.startDate}
</Paragraph>
: <Paragraph>RESULTS AVAILABLE SHORTLY</Paragraph>
: <Paragraph>{i18n.t('voteScreen.wait.messageDateUndefined')}</Paragraph>
}
</Card.Content>
</Card>

View file

@ -70,7 +70,7 @@ class SideBar extends React.Component<Props, State> {
onlyWhenLoggedIn: true,
},
{
name: "VOTE",
name: i18n.t('screens.vote'),
route: "VoteScreen",
icon: "vote",
onlyWhenLoggedIn: true,

View file

@ -256,7 +256,7 @@ function VoteStackComponent() {
options={({navigation}) => {
const openDrawer = getDrawerButton.bind(this, navigation);
return {
title: "VoteScreen",
title: i18n.t('screens.vote'),
headerLeft: openDrawer
};
}}

View file

@ -11,9 +11,9 @@ import VoteResults from "../../components/Amicale/Vote/VoteResults";
import VoteWait from "../../components/Amicale/Vote/VoteWait";
const FAKE_DATE = {
"date_begin": "2020-04-06 21:50",
"date_end": "2020-04-07 23:50",
"date_result_begin": "2020-04-07 21:50",
"date_begin": "2020-04-07 21:50",
"date_end": "2020-04-06 23:50",
"date_result_begin": "2020-04-06 21: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;
if (this.dates.date_result_begin !== null)
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()}/>;
}

View file

@ -15,7 +15,8 @@
"debug": "Debug",
"login": "Login",
"logout": "Logout",
"profile": "Profile"
"profile": "Profile",
"vote": "Elections"
},
"sidenav": {
"divider1": "Student websites",
@ -236,7 +237,7 @@
"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!",
"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": {
"title": "Error!",
@ -257,6 +258,42 @@
"categories": "Categories",
"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": {
"ok": "OK",
"yes": "Yes",

View file

@ -15,7 +15,8 @@
"debug": "Debug",
"login": "Se Connecter",
"logout": "Se Déconnecter",
"profile": "Profil"
"profile": "Profil",
"vote": "Élections"
},
"sidenav": {
"divider1": "Sites étudiants",
@ -257,6 +258,42 @@
"categories": "Catégories",
"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": {
"ok": "OK",
"yes": "Oui",