[FIX] English review: improve view selector tooltips + make translatable

bzr revid: odo@openerp.com-20121221113657-omenasuur2bqj7qy
This commit is contained in:
Olivier Dony 2012-12-21 12:36:57 +01:00
commit 407e6e66e6
2 changed files with 10 additions and 5 deletions

View File

@ -453,11 +453,14 @@ instance.web.ViewManager = instance.web.Widget.extend({
this.active_view = null;
this.views_src = _.map(views, function(x) {
if (x instanceof Array) {
var View = instance.web.views.get_object(x[1], true);
var view_type = x[1];
var View = instance.web.views.get_object(view_type, true);
var view_label = View ? View.prototype.display_name : (void 'nope');
return {
view_id: x[0],
view_type: x[1],
label: View ? View.prototype.display_name : (void 'nope')
view_type: view_type,
label: view_label,
button_label: View ? _.str.sprintf(_t('%(view_type)s view'), {'view_type': (view_label || view_type)}) : (void 'nope'),
};
} else {
return x;

View File

@ -505,8 +505,10 @@
<td>
<ul class="oe_view_manager_switch oe_button_group oe_right">
<t t-if="widget.views_src.length > 1" t-foreach="widget.views_src" t-as="view">
<li class="oe_e"><a t-attf-class="oe_vm_switch_#{view.view_type}" t-att-data-view-type="view.view_type" t-att-title="_t('Switch to ') + (view.label || view.view_type)">
</a></li>
<li class="oe_e">
<a t-attf-class="oe_vm_switch_#{view.view_type}" t-att-data-view-type="view.view_type"
t-att-title="view.button_label"/>
</li>
</t>
</ul>
<div class="oe_view_manager_pager oe_right"/>