From 65eb4dd77b210472dfbed388d5657338e8c0e952 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Thu, 30 Apr 2020 22:49:25 +0200 Subject: [PATCH] Added notification translation --- src/utils/Notifications.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/Notifications.js b/src/utils/Notifications.js index bc5d274..56e19ea 100644 --- a/src/utils/Notifications.js +++ b/src/utils/Notifications.js @@ -2,6 +2,7 @@ import {checkNotifications, requestNotifications, RESULTS} from 'react-native-permissions'; import AsyncStorageManager from "../managers/AsyncStorageManager"; +import i18n from "i18n-js"; const PushNotification = require("react-native-push-notification"); @@ -38,8 +39,8 @@ function createNotifications(machineID: string, date: Date) { let reminderDate = new Date(date); reminderDate.setMinutes(reminderDate.getMinutes() - reminder); PushNotification.localNotificationSchedule({ - title: "Title", - message: "Message", + title: i18n.t("proxiwashScreen.notifications.machineRunningTitle", {time: reminder}), + message: i18n.t("proxiwashScreen.notifications.machineRunningBody", {number: machineID}), id: id.toString(), date: reminderDate, }); @@ -48,8 +49,8 @@ function createNotifications(machineID: string, date: Date) { console.log("Setting up notifications for ", date); PushNotification.localNotificationSchedule({ - title: "Title", - message: "Message", + title: i18n.t("proxiwashScreen.notifications.machineFinishedTitle"), + message: i18n.t("proxiwashScreen.notifications.machineFinishedBody", {number: machineID}), id: machineID, date: date, });