Browse Source

Added notification translation

Arnaud Vergnet 2 years ago
parent
commit
65eb4dd77b
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/utils/Notifications.js

+ 5
- 4
src/utils/Notifications.js View File

@@ -2,6 +2,7 @@
2 2
 
3 3
 import {checkNotifications, requestNotifications, RESULTS} from 'react-native-permissions';
4 4
 import AsyncStorageManager from "../managers/AsyncStorageManager";
5
+import i18n from "i18n-js";
5 6
 
6 7
 const PushNotification = require("react-native-push-notification");
7 8
 
@@ -38,8 +39,8 @@ function createNotifications(machineID: string, date: Date) {
38 39
         let reminderDate = new Date(date);
39 40
         reminderDate.setMinutes(reminderDate.getMinutes() - reminder);
40 41
         PushNotification.localNotificationSchedule({
41
-            title: "Title",
42
-            message: "Message",
42
+            title: i18n.t("proxiwashScreen.notifications.machineRunningTitle", {time: reminder}),
43
+            message: i18n.t("proxiwashScreen.notifications.machineRunningBody", {number: machineID}),
43 44
             id: id.toString(),
44 45
             date: reminderDate,
45 46
         });
@@ -48,8 +49,8 @@ function createNotifications(machineID: string, date: Date) {
48 49
         console.log("Setting up notifications for ", date);
49 50
 
50 51
     PushNotification.localNotificationSchedule({
51
-        title: "Title",
52
-        message: "Message",
52
+        title: i18n.t("proxiwashScreen.notifications.machineFinishedTitle"),
53
+        message: i18n.t("proxiwashScreen.notifications.machineFinishedBody", {number: machineID}),
53 54
         id: machineID,
54 55
         date: date,
55 56
     });

Loading…
Cancel
Save