Really fix translations not loading

This commit is contained in:
Arnaud Vergnet 2020-09-23 09:14:54 +02:00
parent da55abed8f
commit eaf1c52af5
3 changed files with 27 additions and 27 deletions

View file

@ -71,7 +71,7 @@ const styles = StyleSheet.create({
* Component used to display a proxiwash item, showing machine progression and state * Component used to display a proxiwash item, showing machine progression and state
*/ */
class ProxiwashListItem extends React.Component<PropsType> { class ProxiwashListItem extends React.Component<PropsType> {
static stateStrings: {[key in MachineStates]: string} = { stateStrings: {[key in MachineStates]: string} = {
[MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.states.ready'), [MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.states.ready'),
[MachineStates.RUNNING]: i18n.t('screens.proxiwash.states.running'), [MachineStates.RUNNING]: i18n.t('screens.proxiwash.states.running'),
[MachineStates.RUNNING_NOT_STARTED]: i18n.t( [MachineStates.RUNNING_NOT_STARTED]: i18n.t(
@ -146,7 +146,7 @@ class ProxiwashListItem extends React.Component<PropsType> {
? `${props.item.startTime}/${props.item.endTime}` ? `${props.item.startTime}/${props.item.endTime}`
: ''; : '';
const stateIcon = ProxiwashConstants.stateIcons[machineState]; const stateIcon = ProxiwashConstants.stateIcons[machineState];
const stateString = ProxiwashListItem.stateStrings[machineState]; const stateString = this.stateStrings[machineState];
let progress; let progress;
if (isRunning && props.item.donePercent !== '') { if (isRunning && props.item.donePercent !== '') {
progress = parseFloat(props.item.donePercent) / 100; progress = parseFloat(props.item.donePercent) / 100;

View file

@ -84,7 +84,7 @@ class AboutScreen extends React.Component<PropsType, StateType> {
/** /**
* Object containing data relative to major contributors * Object containing data relative to major contributors
*/ */
static majorContributors: {[key: string]: MemberItemType} = { majorContributors: {[key: string]: MemberItemType} = {
arnaud: { arnaud: {
name: 'Arnaud Vergnet', name: 'Arnaud Vergnet',
message: i18n.t('screens.about.user.arnaud'), message: i18n.t('screens.about.user.arnaud'),
@ -115,7 +115,7 @@ class AboutScreen extends React.Component<PropsType, StateType> {
/** /**
* Object containing data relative to users who helped during development * Object containing data relative to users who helped during development
*/ */
static helpfulUsers: {[key: string]: MemberItemType} = { helpfulUsers: {[key: string]: MemberItemType} = {
beranger: { beranger: {
name: 'Béranger Quintana Y Arciosana', name: 'Béranger Quintana Y Arciosana',
message: i18n.t('screens.about.user.beranger'), message: i18n.t('screens.about.user.beranger'),
@ -199,18 +199,18 @@ class AboutScreen extends React.Component<PropsType, StateType> {
teamData: Array<ListItemType> = [ teamData: Array<ListItemType> = [
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.majorContributors.arnaud); this.onContributorListItemPress(this.majorContributors.arnaud);
}, },
icon: AboutScreen.majorContributors.arnaud.icon, icon: this.majorContributors.arnaud.icon,
text: AboutScreen.majorContributors.arnaud.name, text: this.majorContributors.arnaud.name,
showChevron: false, showChevron: false,
}, },
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.majorContributors.yohan); this.onContributorListItemPress(this.majorContributors.yohan);
}, },
icon: AboutScreen.majorContributors.yohan.icon, icon: this.majorContributors.yohan.icon,
text: AboutScreen.majorContributors.yohan.name, text: this.majorContributors.yohan.name,
showChevron: false, showChevron: false,
}, },
{ {
@ -230,42 +230,42 @@ class AboutScreen extends React.Component<PropsType, StateType> {
thanksData: Array<ListItemType> = [ thanksData: Array<ListItemType> = [
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.helpfulUsers.beranger); this.onContributorListItemPress(this.helpfulUsers.beranger);
}, },
icon: AboutScreen.helpfulUsers.beranger.icon, icon: this.helpfulUsers.beranger.icon,
text: AboutScreen.helpfulUsers.beranger.name, text: this.helpfulUsers.beranger.name,
showChevron: false, showChevron: false,
}, },
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.helpfulUsers.celine); this.onContributorListItemPress(this.helpfulUsers.celine);
}, },
icon: AboutScreen.helpfulUsers.celine.icon, icon: this.helpfulUsers.celine.icon,
text: AboutScreen.helpfulUsers.celine.name, text: this.helpfulUsers.celine.name,
showChevron: false, showChevron: false,
}, },
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.helpfulUsers.damien); this.onContributorListItemPress(this.helpfulUsers.damien);
}, },
icon: AboutScreen.helpfulUsers.damien.icon, icon: this.helpfulUsers.damien.icon,
text: AboutScreen.helpfulUsers.damien.name, text: this.helpfulUsers.damien.name,
showChevron: false, showChevron: false,
}, },
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.helpfulUsers.titouan); this.onContributorListItemPress(this.helpfulUsers.titouan);
}, },
icon: AboutScreen.helpfulUsers.titouan.icon, icon: this.helpfulUsers.titouan.icon,
text: AboutScreen.helpfulUsers.titouan.name, text: this.helpfulUsers.titouan.name,
showChevron: false, showChevron: false,
}, },
{ {
onPressCallback: () => { onPressCallback: () => {
this.onContributorListItemPress(AboutScreen.helpfulUsers.theo); this.onContributorListItemPress(this.helpfulUsers.theo);
}, },
icon: AboutScreen.helpfulUsers.theo.icon, icon: this.helpfulUsers.theo.icon,
text: AboutScreen.helpfulUsers.theo.name, text: this.helpfulUsers.theo.name,
showChevron: false, showChevron: false,
}, },
]; ];

View file

@ -86,7 +86,7 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
); );
} }
static modalStateStrings: {[key in MachineStates]: string} = { modalStateStrings: {[key in MachineStates]: string} = {
[MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.modal.ready'), [MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.modal.ready'),
[MachineStates.RUNNING]: i18n.t('screens.proxiwash.modal.running'), [MachineStates.RUNNING]: i18n.t('screens.proxiwash.modal.running'),
[MachineStates.RUNNING_NOT_STARTED]: i18n.t( [MachineStates.RUNNING_NOT_STARTED]: i18n.t(
@ -205,7 +205,7 @@ class ProxiwashScreen extends React.Component<PropsType, StateType> {
icon: '', icon: '',
onPress: () => undefined, onPress: () => undefined,
}; };
let message = ProxiwashScreen.modalStateStrings[item.state]; let message = this.modalStateStrings[item.state];
const onPress = () => this.onSetupNotificationsPress(item); const onPress = () => this.onSetupNotificationsPress(item);
if (item.state === MachineStates.RUNNING) { if (item.state === MachineStates.RUNNING) {
let remainingTime = parseInt(item.remainingTime, 10); let remainingTime = parseInt(item.remainingTime, 10);