Permalink
Browse files

[FIX] mail: translate activity name

This commit fixes two untranslated terms in the activity view.
From the cohort view, when clicking on a cell to see details, the title was not
translated (missing _t call).

The content was not translated either as the language was not present in the
context.
36d4517 was a first step to fix it but while self.record contained data,
self.record.getContext() returns an empty dictionnary (no context is set in the
cohort view).

When computing the context, check that it is not empty, otherwise, fallback on
the session context.

opw-1936855

closes #30942
  • Loading branch information...
mart-e committed Feb 8, 2019
1 parent 785e5f1 commit b6d62f8ce38774fcffd94ee8450ae570def8e900
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-09 10:31+0000\n"
"PO-Revision-Date: 2019-01-09 10:31+0000\n"
"POT-Creation-Date: 2019-02-08 05:29+0000\n"
"PO-Revision-Date: 2019-02-08 05:29+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -345,6 +345,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_needaction
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_needaction
#: model:ir.model.fields,field_description:mail.field_res_partner__message_needaction
#: model:ir.model.fields,field_description:mail.field_res_users__message_needaction
msgid "Action Needed"
msgstr ""

@@ -380,6 +381,7 @@ msgstr ""
#: code:addons/mail/static/src/xml/systray.xml:108
#: model:ir.model.fields,field_description:mail.field_mail_activity_mixin__activity_ids
#: model:ir.model.fields,field_description:mail.field_res_partner__activity_ids
#: model:ir.model.fields,field_description:mail.field_res_users__activity_ids
#: model_terms:ir.ui.view,arch_db:mail.mail_activity_type_view_form
#: model_terms:ir.ui.view,arch_db:mail.mail_activity_type_view_search
#: model_terms:ir.ui.view,arch_db:mail.mail_activity_type_view_tree
@@ -414,6 +416,7 @@ msgstr ""
#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_activity_mixin__activity_state
#: model:ir.model.fields,field_description:mail.field_res_partner__activity_state
#: model:ir.model.fields,field_description:mail.field_res_users__activity_state
msgid "Activity State"
msgstr ""

@@ -449,6 +452,13 @@ msgstr ""
msgid "Add"
msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/chatter.xml:30
#, python-format
msgid "Add Attachments"
msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/xml/followers.xml:63
@@ -737,6 +747,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_attachment_count
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_attachment_count
#: model:ir.model.fields,field_description:mail.field_res_partner__message_attachment_count
#: model:ir.model.fields,field_description:mail.field_res_users__message_attachment_count
msgid "Attachment Count"
msgstr ""

@@ -894,6 +905,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_blacklist_mixin__is_blacklisted
#: model:ir.model.fields,field_description:mail.field_mail_channel_partner__is_blacklisted
#: model:ir.model.fields,field_description:mail.field_res_partner__is_blacklisted
#: model:ir.model.fields,field_description:mail.field_res_users__is_blacklisted
msgid "Blacklist"
msgstr ""

@@ -1083,6 +1095,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_message__channel_ids
#: model:ir.model.fields,field_description:mail.field_mail_wizard_invite__channel_ids
#: model:ir.model.fields,field_description:mail.field_res_partner__channel_ids
#: model:ir.model.fields,field_description:mail.field_res_users__channel_ids
#: model:ir.ui.menu,name:mail.mail_channel_menu_settings
#: model_terms:ir.ui.view,arch_db:mail.mail_channel_partner_view_tree
#, python-format
@@ -1264,12 +1277,13 @@ msgstr ""

#. module: mail
#: model:ir.model.fields,help:mail.field_res_partner__message_bounce
#: model:ir.model.fields,help:mail.field_res_users__message_bounce
msgid "Counter of the number of bounced emails for this contact"
msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/js/discuss.js:565
#: code:addons/mail/static/src/js/discuss.js:566
#, python-format
msgid "Create %s"
msgstr ""
@@ -1563,7 +1577,7 @@ msgstr ""

#. module: mail
#: model:ir.model,name:mail.model_mail_channel
msgid "Discussion channel"
msgid "Discussion Channel"
msgstr ""

#. module: mail
@@ -1621,6 +1635,13 @@ msgstr ""
msgid "Do not keep a copy of the email in the document communication history (mass mailing only)"
msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/js/chatter.js:498
#, python-format
msgid "Do you really want to delete %s?"
msgstr ""

#. module: mail
#: model_terms:ir.ui.view,arch_db:mail.view_document_file_kanban
msgid "Document"
@@ -2059,6 +2080,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_follower_ids
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_follower_ids
#: model:ir.model.fields,field_description:mail.field_res_partner__message_follower_ids
#: model:ir.model.fields,field_description:mail.field_res_users__message_follower_ids
#: model:ir.ui.menu,name:mail.menu_email_followers
#: model_terms:ir.ui.view,arch_db:mail.view_followers_tree
msgid "Followers"
@@ -2069,6 +2091,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_channel_ids
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_channel_ids
#: model:ir.model.fields,field_description:mail.field_res_partner__message_channel_ids
#: model:ir.model.fields,field_description:mail.field_res_users__message_channel_ids
msgid "Followers (Channels)"
msgstr ""

@@ -2077,6 +2100,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_partner_ids
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_partner_ids
#: model:ir.model.fields,field_description:mail.field_res_partner__message_partner_ids
#: model:ir.model.fields,field_description:mail.field_res_users__message_partner_ids
msgid "Followers (Partners)"
msgstr ""

@@ -2333,6 +2357,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_channel__message_unread
#: model:ir.model.fields,help:mail.field_mail_thread__message_unread
#: model:ir.model.fields,help:mail.field_res_partner__message_unread
#: model:ir.model.fields,help:mail.field_res_users__message_unread
msgid "If checked new messages require your attention."
msgstr ""

@@ -2341,6 +2366,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_channel__message_needaction
#: model:ir.model.fields,help:mail.field_mail_thread__message_needaction
#: model:ir.model.fields,help:mail.field_res_partner__message_needaction
#: model:ir.model.fields,help:mail.field_res_users__message_needaction
msgid "If checked, new messages require your attention."
msgstr ""

@@ -2349,6 +2375,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_channel__message_has_error
#: model:ir.model.fields,help:mail.field_mail_thread__message_has_error
#: model:ir.model.fields,help:mail.field_res_partner__message_has_error
#: model:ir.model.fields,help:mail.field_res_users__message_has_error
msgid "If checked, some messages have a delivery error."
msgstr ""

@@ -2378,6 +2405,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_blacklist_mixin__is_blacklisted
#: model:ir.model.fields,help:mail.field_mail_channel_partner__is_blacklisted
#: model:ir.model.fields,help:mail.field_res_partner__is_blacklisted
#: model:ir.model.fields,help:mail.field_res_users__is_blacklisted
msgid "If the email address is on the blacklist, the contact won't receive mass mailing anymore, from any list"
msgstr ""

@@ -2559,6 +2587,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_is_follower
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_is_follower
#: model:ir.model.fields,field_description:mail.field_res_partner__message_is_follower
#: model:ir.model.fields,field_description:mail.field_res_users__message_is_follower
msgid "Is Follower"
msgstr ""

@@ -2577,6 +2606,11 @@ msgstr ""
msgid "Is Subscribed"
msgstr ""

#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_channel__is_chat
msgid "Is a chat"
msgstr ""

#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_channel__is_member
msgid "Is a member"
@@ -2925,6 +2959,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_main_attachment_id
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_main_attachment_id
#: model:ir.model.fields,field_description:mail.field_res_partner__message_main_attachment_id
#: model:ir.model.fields,field_description:mail.field_res_users__message_main_attachment_id
msgid "Main Attachment"
msgstr ""

@@ -3042,6 +3077,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_has_error
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_has_error
#: model:ir.model.fields,field_description:mail.field_res_partner__message_has_error
#: model:ir.model.fields,field_description:mail.field_res_users__message_has_error
msgid "Message Delivery error"
msgstr ""

@@ -3132,6 +3168,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_ids
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_ids
#: model:ir.model.fields,field_description:mail.field_res_partner__message_ids
#: model:ir.model.fields,field_description:mail.field_res_users__message_ids
#: model:ir.ui.menu,name:mail.menu_mail_message
#: model_terms:ir.ui.view,arch_db:mail.view_message_tree
msgid "Messages"
@@ -3428,18 +3465,21 @@ msgstr ""
#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_activity_mixin__activity_date_deadline
#: model:ir.model.fields,field_description:mail.field_res_partner__activity_date_deadline
#: model:ir.model.fields,field_description:mail.field_res_users__activity_date_deadline
msgid "Next Activity Deadline"
msgstr ""

#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_activity_mixin__activity_summary
#: model:ir.model.fields,field_description:mail.field_res_partner__activity_summary
#: model:ir.model.fields,field_description:mail.field_res_users__activity_summary
msgid "Next Activity Summary"
msgstr ""

#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_activity_mixin__activity_type_id
#: model:ir.model.fields,field_description:mail.field_res_partner__activity_type_id
#: model:ir.model.fields,field_description:mail.field_res_users__activity_type_id
msgid "Next Activity Type"
msgstr ""

@@ -3570,6 +3610,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_needaction_counter
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_needaction_counter
#: model:ir.model.fields,field_description:mail.field_res_partner__message_needaction_counter
#: model:ir.model.fields,field_description:mail.field_res_users__message_needaction_counter
msgid "Number of Actions"
msgstr ""

@@ -3583,6 +3624,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_has_error_counter
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_has_error_counter
#: model:ir.model.fields,field_description:mail.field_res_partner__message_has_error_counter
#: model:ir.model.fields,field_description:mail.field_res_users__message_has_error_counter
msgid "Number of error"
msgstr ""

@@ -3591,6 +3633,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_channel__message_needaction_counter
#: model:ir.model.fields,help:mail.field_mail_thread__message_needaction_counter
#: model:ir.model.fields,help:mail.field_res_partner__message_needaction_counter
#: model:ir.model.fields,help:mail.field_res_users__message_needaction_counter
msgid "Number of messages which requires an action"
msgstr ""

@@ -3599,6 +3642,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_channel__message_has_error_counter
#: model:ir.model.fields,help:mail.field_mail_thread__message_has_error_counter
#: model:ir.model.fields,help:mail.field_res_partner__message_has_error_counter
#: model:ir.model.fields,help:mail.field_res_users__message_has_error_counter
msgid "Number of messages with delivery error"
msgstr ""

@@ -3607,6 +3651,7 @@ msgstr ""
#: model:ir.model.fields,help:mail.field_mail_channel__message_unread_counter
#: model:ir.model.fields,help:mail.field_mail_thread__message_unread_counter
#: model:ir.model.fields,help:mail.field_res_partner__message_unread_counter
#: model:ir.model.fields,help:mail.field_res_users__message_unread_counter
msgid "Number of unread messages"
msgstr ""

@@ -3792,9 +3837,12 @@ msgid "Outgoing mail server"
msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/js/views/activity/activity_renderer.js:110
#: selection:mail.activity,state:0
#: selection:mail.activity.mixin,activity_state:0
#: selection:res.partner,activity_state:0
#, python-format
msgid "Overdue"
msgstr ""

@@ -3938,9 +3986,12 @@ msgid "Placeholder Expression"
msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/js/views/activity/activity_renderer.js:112
#: selection:mail.activity,state:0
#: selection:mail.activity.mixin,activity_state:0
#: selection:res.partner,activity_state:0
#, python-format
msgid "Planned"
msgstr ""

@@ -4335,6 +4386,7 @@ msgstr ""
#. module: mail
#: model:ir.model.fields,field_description:mail.field_mail_activity_mixin__activity_user_id
#: model:ir.model.fields,field_description:mail.field_res_partner__activity_user_id
#: model:ir.model.fields,field_description:mail.field_res_users__activity_user_id
msgid "Responsible User"
msgstr ""

@@ -4694,6 +4746,7 @@ msgstr ""
#. module: mail
#: model:ir.model.fields,help:mail.field_mail_activity_mixin__activity_state
#: model:ir.model.fields,help:mail.field_res_partner__activity_state
#: model:ir.model.fields,help:mail.field_res_users__activity_state
msgid "Status based on activities\n"
"Overdue: Due date is already passed\n"
"Today: Activity date is today\n"
@@ -4949,8 +5002,9 @@ msgstr ""

#. module: mail
#. openerp-web
#: code:addons/mail/static/src/js/activity.js:83
#: code:addons/mail/static/src/js/activity.js:87
#: code:addons/mail/static/src/js/models/messages/abstract_message.js:107
#: code:addons/mail/static/src/js/views/activity/activity_renderer.js:111
#: code:addons/mail/static/src/xml/systray.xml:96
#: selection:mail.activity,state:0
#: selection:mail.activity.mixin,activity_state:0
@@ -5122,6 +5176,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_unread
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_unread
#: model:ir.model.fields,field_description:mail.field_res_partner__message_unread
#: model:ir.model.fields,field_description:mail.field_res_users__message_unread
msgid "Unread Messages"
msgstr ""

@@ -5130,6 +5185,7 @@ msgstr ""
#: model:ir.model.fields,field_description:mail.field_mail_channel__message_unread_counter
#: model:ir.model.fields,field_description:mail.field_mail_thread__message_unread_counter
#: model:ir.model.fields,field_description:mail.field_res_partner__message_unread_counter
#: model:ir.model.fields,field_description:mail.field_res_users__message_unread_counter
msgid "Unread Messages Counter"
msgstr ""

@@ -29,11 +29,15 @@ function _readActivities(self, ids) {
if (!ids.length) {
return $.when([]);
}
var context = self.getSession().user_context;
if (self.record && !_.isEmpty(self.record.getContext())) {
context = self.record.getContext();
}
return self._rpc({
model: 'mail.activity',
method: 'activity_format',
args: [ids],
context: (self.record && self.record.getContext()) || self.getSession().user_context,
context: context,
}).then(function (activities) {
// convert create_date and date_deadline to moments
_.each(activities, function (activity) {
@@ -107,9 +107,9 @@ var ActivityRenderer = AbstractRenderer.extend({
activity_ids: {},
activity_state: {
selection: [
['overdue', "Overdue"],
['today', "Today"],
['planned', "Planned"],
['overdue', _t("Overdue")],
['today', _t("Today")],
['planned', _t("Planned")],
],
},
},

0 comments on commit b6d62f8

Please sign in to comment.