Skip to content

Commit

Permalink
Merge branch 'dev#issue12' into 'master'
Browse files Browse the repository at this point in the history
Added translations

See merge request extensions/outlook365!4
  • Loading branch information
agileware-justin committed Dec 16, 2021
2 parents 976efd2 + 6225760 commit e90ade1
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 85 deletions.
208 changes: 159 additions & 49 deletions assets/UIStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,57 +7,167 @@ var UIStrings = (function () {

// JSON object for English strings
UIStrings.default =
{
"Search": "Search",
"Loading": "Retrieving contacts...",
"To": "To",
"Cc": "Cc",
"Bcc": "Bcc",
"Settings": "Settings",
"NotConfigured": "This add in requires additional configuration. Please choose the <strong>Settings</strong> button at the bottom of this window.",
"SettingsScreen": {
"Title": "Settings",
"NotConfigured": "Please enter the URL to the REST endpoint of your CiviCRM and your Site key and API key.<br>If you don't know what this is ask your administrator of CiviCRM.",
"URL": "CiviCRM REST URL",
"URL_Placeholder": "E.g. http://your-site/sites/all/modules/civicrm/extern/rest.php",
"SiteKey": "CiviCRM Site Key",
"ApiKey": "CiviCRM API Key",
"ContactType": "Contact Type",
"Done": "Save"
},
"SaveContactScreen": {
"Title": "Save Contact",
"ContactName": "Contact Name",
"ContactEmail": "Contact Email",
"ContactType": "Contact Type",
"Done": "Done"
}
,
"SaveContactInGroupScreen": {
"Title": "Save Contacts to Group",
"Done": "Save Contacts to Group"
}
};
{
"Search": "Search",
"Loading": "Retrieving contacts...",
"To": "To",
"Cc": "Cc",
"Bcc": "Bcc",
"Settings": "Settings",
"NotConfigured": "This add in requires additional configuration. Please choose the <strong>Settings</strong> button at the bottom of this window.",
"ContactScreen": {
"Placeholder": "Search",
"TitleURL": "View Contact in CiviCRM",
},
"GroupScreen": {
"Placeholder": "Search Group",
"TitleURL": "View Group Settings in CiviCRM",
"SearchContact": "Search contact in group",
"SelectAll": "Select All",
"UnselectAll": "Unselect All",
},
"SettingsScreen": {
"Title": "Settings",
"NotConfigured": "Please enter the URL to the REST endpoint of your CiviCRM and your Site key and API key.<br>If you don't know what this is ask your administrator of CiviCRM.",
"URL": "CiviCRM REST URL",
"URL_Placeholder": "E.g. http://your-site/sites/all/modules/civicrm/extern/rest.php",
"SiteKey": "CiviCRM Site Key",
"ApiKey": "CiviCRM API Key",
"ContactType": "Contact Type",
"Done": "Save"
},
"SaveContactScreen": {
"Title": "Save Contact",
"ContactName": "Contact Name",
"ContactEmail": "Contact Email",
"ContactType": "Contact Type",
"Done": "Done"
},
"SaveContactInGroupScreen": {
"Title": "Save Contacts to Group",
"Done": "Save Contacts to Group",
"Save": "Save Contacts",
"SaveContact": "Save Contact to CiviCRM",
"SavingText": "Contacts are being saved to CiviCRM, please wait...",
"SavedText": "All selected contacts have been saved to CiviCRM",
}
};

// JSON object for Spanish strings
// JSON object for Dutch strings
UIStrings.nl_NL =
{
"Search": "Zoeken",
"Loading": "Contacten ophalen...",
"To": "Aan",
"Cc": "Cc",
"Bcc": "Bcc",
"Settings": "Instellingen",
"NotConfigured": "Deze Add is nog niet geconfigureerd. Klik op de <strong>Instellingen</strong> knop onderaan dit scherm.",
"SettingsScreen": {
"Title": "Instelling",
"NotConfigured": "Geef de URL van de REST interface van je CiviCRM en je sitekey en API key..<br>Mocht je niet weten wat dit is vraag dan de beheerder van je CiviCRM voor deze gegevens.",
"URL": "URL naar je CiviCRM REST interface",
"SiteKey": "Site key",
"ApiKey": "Api Key",
"Done": "Opslaan"
}
};
{
"Search": "Zoeken",
"Loading": "Contacten ophalen...",
"To": "Aan",
"Cc": "Cc",
"Bcc": "Bcc",
"Settings": "Instellingen",
"NotConfigured": "Deze Add is nog niet geconfigureerd. Klik op de <strong>Instellingen</strong> knop onderaan dit scherm.",
"SettingsScreen": {
"Title": "Instelling",
"NotConfigured": "Geef de URL van de REST interface van je CiviCRM en je sitekey en API key..<br>Mocht je niet weten wat dit is vraag dan de beheerder van je CiviCRM voor deze gegevens.",
"URL": "URL naar je CiviCRM REST interface",
"SiteKey": "Site key",
"ApiKey": "Api Key",
"Done": "Opslaan"
}
};

// JSON object for Spanish strings
UIStrings.es_ES =
{
"Search": "Buscar",
"Loading": "Recuperación de contactos...",
"To": "Para",
"Cc": "Cc",
"Bcc": "Cco",
"Settings": "Ajustes",
"NotConfigured": "Este complemento requiere una configuración adicional. Por favor, elija el botón <strong>Configuración</strong> en la parte inferior de esta ventana.",
"ContactScreen": {
"Placeholder": "Buscar",
"TitleURL": "Ver el contacto en CiviCRM",
},
"GroupScreen": {
"Placeholder": "Buscar grupos",
"TitleURL": "Ver la configuración del grupo en CiviCRM",
"SearchContact": "Buscar contactos en el grupo",
"SelectAll": "Selecionar Todo",
"UnselectAll": "Deseleccionar todo",
},
"SettingsScreen": {
"Title": "Ajustes",
"NotConfigured": "Introduzca la URL del punto final REST de su CiviCRM y su clave de sitio y clave de API.<br>Si no sabe qué es, pregunte a su administrador de CiviCRM.",
"URL": "CiviCRM REST URL",
"URL_Placeholder": "Por ejemplo: http://your-site/sites/all/modules/civicrm/extern/rest.php",
"SiteKey": "Clave del sitio de CiviCRM",
"ApiKey": "Clave de la API CiviCRM",
"ContactType": "Tipo de contacto",
"Done": "Guardar"
},
"SaveContactScreen": {
"Title": "Guarda el contacto",
"ContactName": "Nombre del contacto",
"ContactEmail": "Correo electrónico de contacto",
"ContactType": "Tipo de contacto",
"Done": "Guardar"
},
"SaveContactInGroupScreen": {
"Title": "Guarda los contactos en el grupo",
"Done": "Guarda los contactos en el grupo",
"Save": "Guardar",
"SaveContact": "Guarda el contacto en CiviCRM",
"SavingText": "Los contactos se están guardando en CiviCRM, por favor espere...",
"SavedText": "Todos los contactos seleccionados se han guardado en CiviCRM",
}
};

// JSON object for Catalan strings
UIStrings.ca_ES =
{
"Search": "Cerca",
"Loading": "Recuperació de contactes...",
"To": "Per a",
"Cc": "A/c",
"Bcc": "C/o",
"Settings": "Configuració",
"NotConfigured": "Aquest complement requereix una configuració addicional. Si us plau, trieu el botó <strong>Configuració</strong> a la part inferior d'aquesta finestra.",
"ContactScreen": {
"Placeholder": "Cerca",
"TitleURL": "Veure el contacte a CiviCRM",
},
"GroupScreen": {
"Placeholder": "Cerca de grups",
"TitleURL": "Veure la configuració del grup a CiviCRM",
"SearchContact": "Cerca de contactes al grup",
"SelectAll": "Seleccionar tot",
"UnselectAll": "Desseleccionar tot",
},
"SettingsScreen": {
"Title": "Configuració",
"NotConfigured": "Introduïu l'URL del punt final REST del vostre CiviCRM i la vostra clau de lloc i clau d'API.<br>Si no sabeu què és, pregunteu al vostre administrador de CiviCRM.",
"URL": "CiviCRM REST URL",
"URL_Placeholder": "Per exemple: http://your-site/sites/all/modules/civicrm/extern/rest.php",
"SiteKey": "Clau del lloc de CiviCRM",
"ApiKey": "Clau de l'API CiviCRM",
"ContactType": "Tipus de contacte",
"Done": "Desa"
},
"SaveContactScreen": {
"Title": "Desa el contacte",
"ContactName": "Nom de contacte",
"ContactEmail": "Correu electrònic de contacte",
"ContactType": "Tipus de contacte",
"Done": "Desa"
},
"SaveContactInGroupScreen": {
"Title": "Desa els contactes al grup",
"Done": "Desa els contactes al grup",
"Save": "Desa",
"SaveContact": "Desa el contacte a CiviCRM",
"SavingText": "Els contactes s'estan desant a CiviCRM, espereu...",
"SavedText": "Tots els contactes seleccionats s'han desat a CiviCRM",
}
};

UIStrings.getLocaleStrings = function (locale) {
var text;
Expand Down
15 changes: 9 additions & 6 deletions assets/readtaskpane.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
var saveDialog = null
var accessToken = null;

var myLanguage = Office.context.displayLanguage;
var UIText = UIStrings.getLocaleStrings(myLanguage);

jQuery(document).ready(async function () {
// Set localized text for UI elements.
await reset();
Expand Down Expand Up @@ -220,9 +223,9 @@
}

if (res['exist']) {
html += '<a href="' + res.contact_url + '" target="_blank"><i class="ms-Icon ms-Icon--Contact" title="View Contact in CiviCRM"></i></a>'
html += '<a href="' + res.contact_url + '" target="_blank"><i class="ms-Icon ms-Icon--Contact" title="' + UIText.ContactScreen.TitleURL + '"></i></a>'
} else {
html += '<i class="ms-Icon ms-Icon--Save save-contact" title="Save Contact to CiviCRM"></i>'
html += '<i class="ms-Icon ms-Icon--Save save-contact" title="' + UIText.SaveContactInGroupScreen.SaveContact + '"></i>'
}

html += '</div>' +
Expand Down Expand Up @@ -535,13 +538,13 @@
html += '</ul>'

html += '<button class="ms-Button ms-Button--small save-contact-all">' +
'<span class="ms-Button-label">Save Contacts</span>' +
'<span class="ms-Button-label">' + UIText.SaveContactInGroupScreen.Save + '</span>' +
'</button>'
html += '<button class="ms-Button ms-Button--small save-contact-all-group">' +
'<span class="ms-Button-label">Save Contacts to Group</span>' +
'<span class="ms-Button-label">' + UIText.SaveContactInGroupScreen.Title + '</span>' +
'</button>'
html += '<p id="saving-contact-help-text" style="display: none;">Contacts are being saved to CiviCRM, please wait...</p>';
html += '<p id="saved-contact-help-text" style="display: none;">All selected contacts have been saved to CiviCRM</p>';
html += '<p id="saving-contact-help-text" style="display: none;">' + UIText.SaveContactInGroupScreen.SavingText + '</p>';
html += '<p id="saved-contact-help-text" style="display: none;">' + UIText.SaveContactInGroupScreen.SavedText + '</p>';

html += '<br><br>';

Expand Down
18 changes: 9 additions & 9 deletions assets/taskpane.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
reset()
if (currentTab === "contacts") {
$("#search-form").show();
$('#search-form span.ms-SearchBox-text').text('Search');
$('#search-form span.ms-SearchBox-text').text(UIText.ContactScreen.Placeholder);
loadNextContacts()
} else if (currentTab === "groups") {
$("#search-form").show();
$('#search-form span.ms-SearchBox-text').text('Search Group');
$('#search-form span.ms-SearchBox-text').text(UIText.GroupScreen.Placeholder);
loadNextGroups()
}

Expand All @@ -107,7 +107,7 @@
'<input class="ms-SearchBox-field" id="groupSearchField" type="text" value="">' +
'<label class="ms-SearchBox-label">' +
'<i class="ms-SearchBox-icon ms-Icon ms-Icon--Search"></i>' +
'<span class="ms-SearchBox-text">Search</span>' +
'<span class="ms-SearchBox-text">' + UIText.ContactScreen.Placeholder + '</span>' +
'</label>' +
'<div class="ms-CommandButton ms-SearchBox-clear ms-CommandButton--noLabel">' +
'<button class="ms-CommandButton-button">' +
Expand Down Expand Up @@ -264,7 +264,7 @@
name +
'</span>' +
'<div class="ms-ListItem-actions"><div class="ms-ListItem-action">' +
'<a href="' + groupURL + '" target="_blank"><i class="ms-Icon ms-Icon--Settings" title="View Group Settings in CiviCRM"></i></a>' +
'<a href="' + groupURL + '" target="_blank"><i class="ms-Icon ms-Icon--Settings" title="' + UIText.GroupScreen.TitleURL + '"></i></a>' +
'</div></div>' +
'</div>' +
'</div>' +
Expand Down Expand Up @@ -326,10 +326,10 @@
'<button class="ms-Button ms-Button--small bcc"><span class="ms-Button-label">' + UIText.Bcc + '</span></button>';
buttons = '<div class="CiviCRM-Group-Email" data-civicrm-id="' + id + '" data-civicrm-name="' + name + '">' + buttons + '</div>';
$(event.target).parent().append(buttons);
$(event.target).parent().append('<div class="allData"><button class="ms-Button ms-Button--small selectAll"><span class="ms-Button-label">Select All</span></button>' +
'<button class="ms-Button ms-Button--small"><span class="ms-Button-label unselectAll">Unselect All</span></button></div>')
$(event.target).parent().append('<div class="allData"><button class="ms-Button ms-Button--small selectAll"><span class="ms-Button-label">' + UIText.GroupScreen.SelectAll + '</span></button>' +
'<button class="ms-Button ms-Button--small"><span class="ms-Button-label unselectAll">' + UIText.GroupScreen.UnselectAll + '</span></button></div>')
$(event.target).parent().append(getSearchForm(name))
$("#group_search_" + name + " .ms-SearchBox-text").text("Search contact in group");
$("#group_search_" + name + " .ms-SearchBox-text").text(UIText.GroupScreen.SearchContact);

$(event.target).parent().append('<ul class="ms-List ' + name + '-list-email">' + html + '</ul>')
var SearchBoxElements = document.querySelectorAll(".ms-SearchBox");
Expand Down Expand Up @@ -421,7 +421,7 @@
'<span class=""ms-ListItem-primaryText">' + contact.display_name + '</span>' +
'<div class="ms-ListItem-selectionTarget"></div>' +
'<div class="ms-ListItem-actions"><div class="ms-ListItem-action">' +
'<a href="' + contact_url + '" target="_blank"><i class="ms-Icon ms-Icon--Contact" title="View Contact in CiviCRM"></i></a>' +
'<a href="' + contact_url + '" target="_blank"><i class="ms-Icon ms-Icon--Contact" title="' + UIText.ContactScreen.TitleURL + '"></i></a>' +
'</div></div>' +
'</li>';
// break
Expand Down Expand Up @@ -576,7 +576,7 @@
'<div class="ms-Persona-details">' +
'<div class="ms-Persona-primaryText">' + name + '</div>' +
'<div class="ms-ListItem-actions search-contact-profile"><div class="ms-ListItem-action">' +
'<a href="' + contact_url + '" target="_blank"><i class="ms-Icon ms-Icon--Contact" title="View Contact in CiviCRM"></i></a>' +
'<a href="' + contact_url + '" target="_blank"><i class="ms-Icon ms-Icon--Contact" title="' + UIText.ContactScreen.TitleURL + '"></i></a>' +
'</div></div>' +
'<div class="ms-Persona-secondaryText">' + email + '</div>' +
secondaryFields +
Expand Down
10 changes: 6 additions & 4 deletions templates/CRM/Outlook365/Page/Manifest.tpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{crmScope extensionKey='outlook365'}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides/1.0" xsi:type="MailApp">
<Id>{$guid}</Id>
<Version>1.0.0.0</Version>
<ProviderName>{$default_contact_name|escape}</ProviderName>
<DefaultLocale>en-US</DefaultLocale>
<DisplayName DefaultValue="{$default_contact|escape}"/>
<Description DefaultValue="Integrate outlook 365 with CiviCRM."/>
<Description DefaultValue="{ts}Integrate outlook 365 with CiviCRM.{/ts}"/>
<IconUrl DefaultValue="{$baseurl}assets/CiviCRM-icon-2019-F-small.png"/>
<HighResolutionIconUrl DefaultValue="{$baseurl}assets/CiviCRM-icon-2019-F-small.png"/>
<SupportUrl DefaultValue="https://www.civicrm.org"/>
Expand Down Expand Up @@ -100,12 +101,13 @@
<bt:Url id="ReadTaskpane.Url" DefaultValue="{crmURL p='civicrm/outlook365/readtaskpane.html' a=1 fe=1}"/>
</bt:Urls>
<bt:ShortStrings>
<bt:String id="GroupLabel" DefaultValue="CiviCRM Contacts"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="CiviCRM Contacts"/>
<bt:String id="GroupLabel" DefaultValue="{ts}CiviCRM Contacts{/ts}"/>
<bt:String id="TaskpaneButton.Label" DefaultValue="{ts}CiviCRM Contacts{/ts}"/>
</bt:ShortStrings>
<bt:LongStrings>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="Search civicrm contacts within Outlook."/>
<bt:String id="TaskpaneButton.Tooltip" DefaultValue="{ts}Search civicrm contacts within Outlook.{/ts}"/>
</bt:LongStrings>
</Resources>
</VersionOverrides>
</OfficeApp>
{/crmScope}
Loading

0 comments on commit e90ade1

Please sign in to comment.