Browse Source

Really fix translations not loading

Arnaud Vergnet 1 year ago
parent
commit
eaf1c52af5

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

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

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

@@ -84,7 +84,7 @@ class AboutScreen extends React.Component<PropsType, StateType> {
84 84
   /**
85 85
    * Object containing data relative to major contributors
86 86
    */
87
-  static majorContributors: {[key: string]: MemberItemType} = {
87
+  majorContributors: {[key: string]: MemberItemType} = {
88 88
     arnaud: {
89 89
       name: 'Arnaud Vergnet',
90 90
       message: i18n.t('screens.about.user.arnaud'),
@@ -115,7 +115,7 @@ class AboutScreen extends React.Component<PropsType, StateType> {
115 115
   /**
116 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 119
     beranger: {
120 120
       name: 'Béranger Quintana Y Arciosana',
121 121
       message: i18n.t('screens.about.user.beranger'),
@@ -199,18 +199,18 @@ class AboutScreen extends React.Component<PropsType, StateType> {
199 199
   teamData: Array<ListItemType> = [
200 200
     {
201 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 206
       showChevron: false,
207 207
     },
208 208
     {
209 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 214
       showChevron: false,
215 215
     },
216 216
     {
@@ -230,42 +230,42 @@ class AboutScreen extends React.Component<PropsType, StateType> {
230 230
   thanksData: Array<ListItemType> = [
231 231
     {
232 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 237
       showChevron: false,
238 238
     },
239 239
     {
240 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 245
       showChevron: false,
246 246
     },
247 247
     {
248 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 253
       showChevron: false,
254 254
     },
255 255
     {
256 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 261
       showChevron: false,
262 262
     },
263 263
     {
264 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 269
       showChevron: false,
270 270
     },
271 271
   ];

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

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

Loading…
Cancel
Save