diff --git a/addons/crm_mail_plugin/__manifest__.py b/addons/crm_mail_plugin/__manifest__.py
index aec93db3e10..9670b49eaf2 100644
--- a/addons/crm_mail_plugin/__manifest__.py
+++ b/addons/crm_mail_plugin/__manifest__.py
@@ -17,6 +17,9 @@
'views/crm_mail_plugin_lead.xml',
'views/crm_lead_views.xml'
],
+ 'web.assets_backend': [
+ 'crm_mail_plugin/static/src/to_translate/**/*',
+ ],
'installable': True,
'application': False,
'auto_install': True
diff --git a/addons/crm_mail_plugin/controllers/mail_plugin.py b/addons/crm_mail_plugin/controllers/mail_plugin.py
index de5ac25e0c0..64685c3c69f 100644
--- a/addons/crm_mail_plugin/controllers/mail_plugin.py
+++ b/addons/crm_mail_plugin/controllers/mail_plugin.py
@@ -61,3 +61,6 @@ class MailPluginController(mail_plugin.MailPluginController):
def _mail_content_logging_models_whitelist(self):
return super(MailPluginController, self)._mail_content_logging_models_whitelist() + ['crm.lead']
+
+ def _translation_modules_whitelist(self):
+ return super(MailPluginController, self)._translation_modules_whitelist() + ['crm_mail_plugin']
diff --git a/addons/crm_mail_plugin/static/src/to_translate/translations_outlook.xml b/addons/crm_mail_plugin/static/src/to_translate/translations_outlook.xml
new file mode 100644
index 00000000000..22ce4b7c5fd
--- /dev/null
+++ b/addons/crm_mail_plugin/static/src/to_translate/translations_outlook.xml
@@ -0,0 +1,11 @@
+
+
+
+ Log Email Into Lead
+ Opportunities
+ Opportunities (%(count)s)
+ %(expected_revenue)s at %(probability)s%
+ %(expected_revenue)s + %(recurring_revenue)s %(recurring_plan)s at %(probability)s%
+ Save Contact to create new Opportunities.
+ No opportunities found for this contact.
+
diff --git a/addons/mail_plugin/__manifest__.py b/addons/mail_plugin/__manifest__.py
index e2318644207..9f9bf11f784 100644
--- a/addons/mail_plugin/__manifest__.py
+++ b/addons/mail_plugin/__manifest__.py
@@ -13,6 +13,9 @@
'contacts',
'iap'
],
+ 'web.assets_backend': [
+ 'mail_plugin/static/src/to_translate/**/*',
+ ],
'data': [
'views/mail_plugin_login.xml',
'views/res_partner_iap_views.xml',
diff --git a/addons/mail_plugin/controllers/mail_plugin.py b/addons/mail_plugin/controllers/mail_plugin.py
index b7f5ac83a81..608b8cddb20 100644
--- a/addons/mail_plugin/controllers/mail_plugin.py
+++ b/addons/mail_plugin/controllers/mail_plugin.py
@@ -165,6 +165,10 @@ class MailPluginController(http.Controller):
raise Forbidden()
request.env[model].browse(res_id).message_post(body=message)
+ @http.route('/mail_plugin/get_translations', type="json", auth="outlook", cors="*")
+ def get_translations(self):
+ return self._prepare_translations()
+
def _iap_enrich(self, domain):
enriched_data = {}
try:
@@ -311,3 +315,22 @@ class MailPluginController(http.Controller):
"""
domain = tools.email_domain_extract(email)
return ("@" + domain) if domain not in iap_tools._MAIL_DOMAIN_BLACKLIST else email
+
+ def _translation_modules_whitelist(self):
+ """
+ Returns the list of modules to be translated
+ Other mail plugin modules have to override this method to include their module names
+ """
+ return ['mail_plugin']
+
+ def _prepare_translations(self):
+ lang = request.env['res.users'].browse(request.uid).lang
+ translations_per_module = request.env["ir.translation"].get_translations_for_webclient(
+ self._translation_modules_whitelist(), lang)[0]
+ translations_dict = {}
+ for module in self._translation_modules_whitelist():
+ translations = translations_per_module.get(module, {})
+ messages = translations.get('messages', {})
+ for message in messages:
+ translations_dict.update({message['id']: message['string']})
+ return translations_dict
diff --git a/addons/mail_plugin/static/src/to_translate/translations_outlook.xml b/addons/mail_plugin/static/src/to_translate/translations_outlook.xml
new file mode 100644
index 00000000000..9d2489ac772
--- /dev/null
+++ b/addons/mail_plugin/static/src/to_translate/translations_outlook.xml
@@ -0,0 +1,39 @@
+
+
+
+ Logout
+ Company created
+ Company Insights
+ Revenues
+ Company Type
+ Keywords
+ Year founded
+ Employees
+ Industry
+ Website
+ Phone
+ Address
+ Contact created
+ Buy More
+ Search In Odoo
+ Search In Database
+ Contacts Found (%(count)s)
+ Search contact in Odoo...
+ Refresh Contact
+ Add Contact To Database
+ Contact Details
+ Log Email Into Contact
+ This contact has no email address, no company could be enriched
+ No company attached to this contact
+ Create a Company
+ No company linked to this contact could be enriched
+ No company linked to this contact could be enriched or found in Odoo
+ No data found for this email address.
+ You don't have enough credit to enrich.
+ Something bad happened. Please, try again later.
+ Could not autocomplete the company. Internal error. Try again later...
+ There was a problem contacting the service, please try again later.
+ An error has occurred when trying to fetch translations.
+