Skip to content

Commit

Permalink
Add translations to appointment body
Browse files Browse the repository at this point in the history
  • Loading branch information
timetheoretical committed Jun 3, 2020
1 parent 78f029a commit e953411
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion JitsiMeetOutlook/NewJitsiAppointment.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Text.Json;
using Outlook = Microsoft.Office.Interop.Outlook;
using MessageBox = System.Windows.Forms.MessageBox;

Expand All @@ -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;

Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e953411

Please sign in to comment.