From e953411a46169b3ceffa1cecc85571626ed3b23a Mon Sep 17 00:00:00 2001 From: timetheoretical Date: Wed, 3 Jun 2020 19:06:39 +0100 Subject: [PATCH] Add translations to appointment body --- JitsiMeetOutlook/NewJitsiAppointment.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/JitsiMeetOutlook/NewJitsiAppointment.cs b/JitsiMeetOutlook/NewJitsiAppointment.cs index 0992276..fdff074 100644 --- a/JitsiMeetOutlook/NewJitsiAppointment.cs +++ b/JitsiMeetOutlook/NewJitsiAppointment.cs @@ -1,4 +1,5 @@ using System; +using System.Text.Json; using Outlook = Microsoft.Office.Interop.Outlook; using MessageBox = System.Windows.Forms.MessageBox; @@ -9,9 +10,13 @@ class NewJitsiAppointment private Outlook.AppointmentItem newAppointment; private AppointmentRibbonGroup thisRibbon; + JsonElement jsonUILanguage; public NewJitsiAppointment() { + // Set language + setJsonNode(); + // Get the Application object Outlook.Application application = Globals.ThisAddIn.Application; @@ -26,7 +31,7 @@ public NewJitsiAppointment() // Appointment details newAppointment.Location = "Jitsi Meet"; - newAppointment.Body = "Join the meeting: " + (JitsiUrl.getUrlBase() + jitsiRoomId); + newAppointment.Body = getLanguageValue("textBodyMessage") + (JitsiUrl.getUrlBase() + jitsiRoomId); // Display ribbon group, then the appointment window Globals.ThisAddIn.ShowRibbonAppointment = true; @@ -53,6 +58,16 @@ private void findThisRibbon() thisRibbon = Globals.Ribbons[inspector].AppointmentRibbonGroup; } + private void setJsonNode() + { + jsonUILanguage = Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("appointmentItem"); + } + + private string getLanguageValue(string property) + { + return jsonUILanguage.GetProperty(property).GetString(); + } + private string getRoomId() { string roomId;