Browse Source

Really fix translations not loading

Arnaud Vergnet 3 years ago
parent
commit
eaf1c52af5

+ 2
- 2
src/components/Lists/Proxiwash/ProxiwashListItem.tsx View File

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

+ 23
- 23
src/screens/About/AboutScreen.tsx View File

84
   /**
84
   /**
85
    * Object containing data relative to major contributors
85
    * Object containing data relative to major contributors
86
    */
86
    */
87
-  static majorContributors: {[key: string]: MemberItemType} = {
87
+  majorContributors: {[key: string]: MemberItemType} = {
88
     arnaud: {
88
     arnaud: {
89
       name: 'Arnaud Vergnet',
89
       name: 'Arnaud Vergnet',
90
       message: i18n.t('screens.about.user.arnaud'),
90
       message: i18n.t('screens.about.user.arnaud'),
115
   /**
115
   /**
116
    * Object containing data relative to users who helped during development
116
    * Object containing data relative to users who helped during development
117
    */
117
    */
118
-  static helpfulUsers: {[key: string]: MemberItemType} = {
118
+  helpfulUsers: {[key: string]: MemberItemType} = {
119
     beranger: {
119
     beranger: {
120
       name: 'Béranger Quintana Y Arciosana',
120
       name: 'Béranger Quintana Y Arciosana',
121
       message: i18n.t('screens.about.user.beranger'),
121
       message: i18n.t('screens.about.user.beranger'),
199
   teamData: Array<ListItemType> = [
199
   teamData: Array<ListItemType> = [
200
     {
200
     {
201
       onPressCallback: () => {
201
       onPressCallback: () => {
202
-        this.onContributorListItemPress(AboutScreen.majorContributors.arnaud);
202
+        this.onContributorListItemPress(this.majorContributors.arnaud);
203
       },
203
       },
204
-      icon: AboutScreen.majorContributors.arnaud.icon,
205
-      text: AboutScreen.majorContributors.arnaud.name,
204
+      icon: this.majorContributors.arnaud.icon,
205
+      text: this.majorContributors.arnaud.name,
206
       showChevron: false,
206
       showChevron: false,
207
     },
207
     },
208
     {
208
     {
209
       onPressCallback: () => {
209
       onPressCallback: () => {
210
-        this.onContributorListItemPress(AboutScreen.majorContributors.yohan);
210
+        this.onContributorListItemPress(this.majorContributors.yohan);
211
       },
211
       },
212
-      icon: AboutScreen.majorContributors.yohan.icon,
213
-      text: AboutScreen.majorContributors.yohan.name,
212
+      icon: this.majorContributors.yohan.icon,
213
+      text: this.majorContributors.yohan.name,
214
       showChevron: false,
214
       showChevron: false,
215
     },
215
     },
216
     {
216
     {
230
   thanksData: Array<ListItemType> = [
230
   thanksData: Array<ListItemType> = [
231
     {
231
     {
232
       onPressCallback: () => {
232
       onPressCallback: () => {
233
-        this.onContributorListItemPress(AboutScreen.helpfulUsers.beranger);
233
+        this.onContributorListItemPress(this.helpfulUsers.beranger);
234
       },
234
       },
235
-      icon: AboutScreen.helpfulUsers.beranger.icon,
236
-      text: AboutScreen.helpfulUsers.beranger.name,
235
+      icon: this.helpfulUsers.beranger.icon,
236
+      text: this.helpfulUsers.beranger.name,
237
       showChevron: false,
237
       showChevron: false,
238
     },
238
     },
239
     {
239
     {
240
       onPressCallback: () => {
240
       onPressCallback: () => {
241
-        this.onContributorListItemPress(AboutScreen.helpfulUsers.celine);
241
+        this.onContributorListItemPress(this.helpfulUsers.celine);
242
       },
242
       },
243
-      icon: AboutScreen.helpfulUsers.celine.icon,
244
-      text: AboutScreen.helpfulUsers.celine.name,
243
+      icon: this.helpfulUsers.celine.icon,
244
+      text: this.helpfulUsers.celine.name,
245
       showChevron: false,
245
       showChevron: false,
246
     },
246
     },
247
     {
247
     {
248
       onPressCallback: () => {
248
       onPressCallback: () => {
249
-        this.onContributorListItemPress(AboutScreen.helpfulUsers.damien);
249
+        this.onContributorListItemPress(this.helpfulUsers.damien);
250
       },
250
       },
251
-      icon: AboutScreen.helpfulUsers.damien.icon,
252
-      text: AboutScreen.helpfulUsers.damien.name,
251
+      icon: this.helpfulUsers.damien.icon,
252
+      text: this.helpfulUsers.damien.name,
253
       showChevron: false,
253
       showChevron: false,
254
     },
254
     },
255
     {
255
     {
256
       onPressCallback: () => {
256
       onPressCallback: () => {
257
-        this.onContributorListItemPress(AboutScreen.helpfulUsers.titouan);
257
+        this.onContributorListItemPress(this.helpfulUsers.titouan);
258
       },
258
       },
259
-      icon: AboutScreen.helpfulUsers.titouan.icon,
260
-      text: AboutScreen.helpfulUsers.titouan.name,
259
+      icon: this.helpfulUsers.titouan.icon,
260
+      text: this.helpfulUsers.titouan.name,
261
       showChevron: false,
261
       showChevron: false,
262
     },
262
     },
263
     {
263
     {
264
       onPressCallback: () => {
264
       onPressCallback: () => {
265
-        this.onContributorListItemPress(AboutScreen.helpfulUsers.theo);
265
+        this.onContributorListItemPress(this.helpfulUsers.theo);
266
       },
266
       },
267
-      icon: AboutScreen.helpfulUsers.theo.icon,
268
-      text: AboutScreen.helpfulUsers.theo.name,
267
+      icon: this.helpfulUsers.theo.icon,
268
+      text: this.helpfulUsers.theo.name,
269
       showChevron: false,
269
       showChevron: false,
270
     },
270
     },
271
   ];
271
   ];

+ 2
- 2
src/screens/Proxiwash/ProxiwashScreen.tsx View File

86
     );
86
     );
87
   }
87
   }
88
 
88
 
89
-  static modalStateStrings: {[key in MachineStates]: string} = {
89
+  modalStateStrings: {[key in MachineStates]: string} = {
90
     [MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.modal.ready'),
90
     [MachineStates.AVAILABLE]: i18n.t('screens.proxiwash.modal.ready'),
91
     [MachineStates.RUNNING]: i18n.t('screens.proxiwash.modal.running'),
91
     [MachineStates.RUNNING]: i18n.t('screens.proxiwash.modal.running'),
92
     [MachineStates.RUNNING_NOT_STARTED]: i18n.t(
92
     [MachineStates.RUNNING_NOT_STARTED]: i18n.t(
205
       icon: '',
205
       icon: '',
206
       onPress: () => undefined,
206
       onPress: () => undefined,
207
     };
207
     };
208
-    let message = ProxiwashScreen.modalStateStrings[item.state];
208
+    let message = this.modalStateStrings[item.state];
209
     const onPress = () => this.onSetupNotificationsPress(item);
209
     const onPress = () => this.onSetupNotificationsPress(item);
210
     if (item.state === MachineStates.RUNNING) {
210
     if (item.state === MachineStates.RUNNING) {
211
       let remainingTime = parseInt(item.remainingTime, 10);
211
       let remainingTime = parseInt(item.remainingTime, 10);

Loading…
Cancel
Save