Merge lp:~openerp-dev/openobject-addons/7.0-opw-586673-msh into lp:openobject-addons/7.0

Proposed by Mohammed Shekha(Open ERP) on 2013-02-28
Status: Merged
Approved by: Naresh(OpenERP) on 2013-04-11
Approved revision: no longer in the source branch.
Merged at revision: 9210
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-586673-msh
Merge into: lp:openobject-addons/7.0
Diff against target: 37 lines (+18/-2)
1 file modified
mail/static/src/js/mail.js (+18/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-586673-msh
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Needs Fixing on 2013-06-06
Naresh(OpenERP) (community) 2013-02-28 Approve on 2013-04-11
Review via email: mp+150963@code.launchpad.net

Description of the change

Hello,

Fixxed the issues of chatter translation..

Override the strings of timeago plugin of jquery with translated terms.

Demo :- Go to any mail_thread widget, the read more and read less terms are not tranlated also the timeago lib strings are not translated so just overrides that terms with translated terms.

Thanks.

To post a comment you must log in.
review: Approve
Olivier Dony (Odoo) (odo-openerp) wrote :

Some languages need to use suffixAgo while other languages need prefixAgo. This would be hard to get done properly by OpenERP translators, so we should use the existing jQuery.timeago translations, similarly to how we load translations for Date.js. See https://github.com/rmm5t/jquery-timeago/tree/master/locales

I'll do a manual merge of the "read more" / "read less" part in the mean time.

review: Needs Fixing
Olivier Dony (Odoo) (odo-openerp) wrote :

Actually a better variation of the second part of this patch was already merged in web 7.0 at revision 2661 revid:<email address hidden>, so we can ignore that part.

Olivier Dony (Odoo) (odo-openerp) wrote :

Closing this MP as "pseudo-merged", since the first part was cherry-picked at revision 9200.1.3 revid:<email address hidden> in addons 7.0, completing the merge of the whole patch.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mail/static/src/js/mail.js'
2--- mail/static/src/js/mail.js 2013-02-08 11:52:38 +0000
3+++ mail/static/src/js/mail.js 2013-02-28 07:06:21 +0000
4@@ -831,8 +831,8 @@
5 expender: function () {
6 this.$('.oe_msg_body:first').expander({
7 slicePoint: this.options.truncate_limit,
8- expandText: 'read more',
9- userCollapseText: 'read less',
10+ expandText: _t('read more'),
11+ userCollapseText: _t('read less'),
12 detailClass: 'oe_msg_tail',
13 moreClass: 'oe_mail_expand',
14 lessClass: 'oe_mail_reduce',
15@@ -1612,6 +1612,22 @@
16 'show_compact_message': 1,
17 }, this.node.params);
18
19+ _.extend($.timeago.settings.strings, {
20+ suffixAgo: _t("ago"),
21+ suffixFromNow: _t("from now"),
22+ seconds: _t("less than a minute"),
23+ minute: _t("about a minute"),
24+ minutes: "%d "+ _t("minutes"),
25+ hour: _t("about an hour"),
26+ hours: _t("about") + " %d " + _t("hours"),
27+ day: _t("a day"),
28+ days: "%d " + _t("days"),
29+ month: _t("about a month"),
30+ months: "%d " + _t("months"),
31+ year: _t("about a year"),
32+ years: "%d " + _t("years"),
33+ });
34+
35 if (this.node.attrs.placeholder) {
36 this.node.params.compose_placeholder = this.node.attrs.placeholder;
37 }