Skip to content
Permalink
Browse files

[IMP]generic: strings inside t-attf-attribute is not translatable, co…

…nsider the case t-attf-attribute='Some String #{something}' here 'Some String' will not be exported while trnaslation generated and hence never gonna translated, as translation engine ignores attributes start with t-
  • Loading branch information...
pla-odoo authored and msh-odoo committed Apr 1, 2019
1 parent bc6a680 commit 092e9877d40e3211def64adf493dd48c9b5394c7
@@ -59,8 +59,9 @@
</small>
<!-- List of followers -->
<div class="o_composer_suggested_partners">
<t t-set="title">Add as recipient and follower (reason:</t>
<t t-foreach='widget.suggestedPartners' t-as='recipient'>
<div t-attf-title="Add as recipient and follower (reason: #{recipient.reason})" t-att-class="recipient_index > 2 ? 'o_suggested_toggle o_hidden' : ''">
<div t-attf-title="#{title} #{recipient.reason})" t-att-class="recipient_index > 2 ? 'o_suggested_toggle o_hidden' : ''">
<div class="custom-control custom-checkbox">
<input type="checkbox"
class="custom-control-input"
@@ -100,7 +100,8 @@

<t t-name="FieldMany2ManyTagsEmail" t-extend="FieldMany2ManyTag">
<t t-jquery="[t-attf-class*=badge]" t-operation="replace">
<div t-attf-class="badge badge-pill dropdown o_tag_color_0 #{el.email.indexOf('@') &lt; 0 ? 'o_tag_error' : ''}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id" t-attf-title="Tag color: #{colornames[color]}">
<t t-set="title">Tag color:</t>
<div t-attf-class="badge badge-pill dropdown o_tag_color_0 #{el.email.indexOf('@') &lt; 0 ? 'o_tag_error' : ''}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id" t-attf-title="#{title} #{colornames[color]}">
<span class="o_badge_text" t-att-title="el.email"><t t-esc="el.display_name"/></span>
<a t-if="!readonly" href="#" class="fa fa-times o_delete" title="Delete" aria-label="Delete"/>
</div>
@@ -1965,6 +1965,9 @@ var FieldMany2ManyTags = AbstractField.extend({
}

this.colorField = this.nodeOptions.color_field;
this.colornames = [_t('No color'), _t('Red'), _t('Orange'), _t('Yellow'), _t('Light blue'),
_t('Dark purple'), _t('Salmon pink'), _t('Medium blue'), _t('Dark blue'), _t('Fushia'),
_t('Green'), _t('Purple')];
this.hasDropdown = false;
},

@@ -2033,6 +2036,7 @@ var FieldMany2ManyTags = AbstractField.extend({
var elements = this.value ? _.pluck(this.value.data, 'data') : [];
return {
colorField: this.colorField,
colornames: this.colornames,
elements: elements,
hasDropdown: this.hasDropdown,
readonly: this.mode === "readonly",
@@ -314,6 +314,7 @@ var Float = Field.extend({
init: function (parent) {
this._super(parent);
this.decimal_point = _t.database.parameters.decimal_point;
this.title = _.str.sprintf(_t('Number using %s as decimal separator.'), this.decimal_point || '.');
},
toString: function () {
return this.$el.val();
@@ -118,7 +118,7 @@
<div t-attf-class="o_notification #{widget.className}" t-translation="off" role="alertdialog">
<a t-if="widget.sticky" class="fa fa-times o_close" href="#" title="Close" aria-label="Close"/>
<div class="o_notification_title">
<span t-attf-class="o_icon fa fa-3x #{widget.icon}" role="img" t-attf-aria-label="Notification #{widget.name}" t-attf-title="Notification #{widget.name}"/>
<span t-attf-class="o_icon fa fa-3x #{widget.icon}" role="img" aria-label="Notification" title="Notification"/>
<t t-raw="widget.title"/>
</div>
<div class="o_notification_content" t-if="widget.message"><t t-raw="widget.message"/></div>
@@ -209,10 +209,11 @@
</t>

<t t-name="ControlPanel.SwitchButton">
<t t-set="title">View</t>
<button type="button" t-att-accesskey="view.accessKey"
t-attf-class="btn btn-secondary fa fa-lg #{view.icon} o_cp_switch_#{view.type} #{viewType === view.type ? ' active' : ''}"
t-attf-aria-label="View #{view.type}"
t-att-data-view-type="view.type" t-attf-title="View #{view.type}" tabindex="-1"/>
t-attf-aria-label="#{title} #{view.displayName}"
t-att-data-view-type="view.type" t-attf-title="#{title} #{view.displayName}" tabindex="-1"/>
</t>

<t t-name="ControlPanel.SwitchButtons.Mobile">
@@ -848,10 +849,10 @@
<t t-name="FieldMany2ManyTag">
<t t-foreach="elements" t-as="el">
<t t-set="color" t-value="el[colorField] || 0"/>
<t t-set="colornames" t-value="['No color', 'Red', 'Orange', 'Yellow', 'Light blue', 'Dark purple', 'Salmon pink', 'Medium blue', 'Dark blue', 'Fushia', 'Green', 'Purple']"/>
<div t-attf-class="badge badge-pill #{hasDropdown ? 'dropdown' : ''} o_tag_color_#{color}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id" t-attf-title="Tag color: #{colornames[color]}">
<t t-set="title">Tag color:</t>
<div t-attf-class="badge badge-pill #{hasDropdown ? 'dropdown' : ''} o_tag_color_#{color}" t-att-data-color="color" t-att-data-index="el_index" t-att-data-id="el.id" t-attf-title="#{title} #{colornames[color]}">
<t t-set="_badge_text">
<span class="o_badge_text" t-att-title="el.display_name"><span role="img" t-attf-aria-label="Tag color: #{colornames[color]}"/><t t-esc="el.display_name"/></span>
<span class="o_badge_text" t-att-title="el.display_name"><span role="img" t-attf-aria-label="#{title} #{colornames[color]}"/><t t-esc="el.display_name"/></span>
</t>
<t t-if="hasDropdown">
<a role="button" href="#" class="dropdown-toggle o-no-caret" data-toggle="dropdown" aria-expanded="false">
@@ -926,17 +927,20 @@
</t>
<t t-name="FieldStatus.content.button">
<t t-set="disabled" t-value="!clickable"/>
<t t-set="aria_label">is current state</t>
<button type="button" t-att-data-value="i.id" disabled="disabled" title="Current state" aria-pressed="true"
t-attf-class="btn o_arrow_button btn-primary disabled #{is_dropdown ? 'dropdown-item bg-primary text-white': ''}" t-if="i.selected" aria-current="step">
<t t-esc="i.display_name" role="img" t-attf-aria-label="#{i.display_name} is current state"/>
t-attf-class="btn o_arrow_button btn-primary disabled #{is_dropdown ? 'dropdown-item bg-primary text-white': ''}" t-if="i.selected" aria-current="step" t-attf-aria-label="#{i.display_name} #{aria_label}">
<t t-esc="i.display_name" role="img"/>
</button>
<t t-set="aria_label">is not current state</t>
<button type="button" t-att-data-value="i.id" disabled="disabled" title="Not active state" aria-pressed="false"
t-attf-class="btn o_arrow_button btn-secondary disabled #{is_dropdown ? 'dropdown-item': ''}" t-if="!i.selected and disabled">
<t t-esc="i.display_name" role="img" t-attf-aria-label="#{i.display_name} is not current state"/>
t-attf-class="btn o_arrow_button btn-secondary disabled #{is_dropdown ? 'dropdown-item': ''}" t-if="!i.selected and disabled" t-attf-aria-label="#{i.display_name} #{aria_label}">
<t t-esc="i.display_name" role="img"/>
</button>
<t t-set="aria_label">Click to change current state to </t>
<button type="button" t-att-data-value="i.id" title="Not active state, click to change it" aria-pressed="false"
t-attf-class="btn o_arrow_button btn-secondary #{is_dropdown ? 'dropdown-item': ''}" t-if="!i.selected and !disabled">
<t t-esc="i.display_name" role="img" t-attf-aria-label="Click to change current state to #{i.display_name}"/>
t-attf-class="btn o_arrow_button btn-secondary #{is_dropdown ? 'dropdown-item': ''}" t-if="!i.selected and !disabled" t-attf-aria-label="#{aria_label} #{i.display_name}">
<t t-esc="i.display_name" role="img"/>
</button>
</t>
<t t-name="FieldBinaryImage">
@@ -1316,7 +1320,7 @@
<t t-name="SearchView.extended_search.proposition.float">
<input class="o_input"
t-att-type="widget.decimal_point === '.' ? 'number' : 'text'"
t-attf-title="Number using #{widget.decimal_point || '.' } as decimal separator."
t-att-title="widget.title"
t-attf-pattern="[0-9]+([\\#{widget.decimal_point || '.' }][0-9]+)?"
t-attf-value="0#{widget.decimal_point || '.' }0" step="0.01"/>
</t>
@@ -52,7 +52,7 @@ QUnit.module('Services', {
await testUtils.nextMicrotaskTick();
var $notification = $('body .o_notification_manager .o_notification');
assert.strictEqual(_.str.trim($notification.html().replace(/\s+/g, ' ')),
"<div class=\"o_notification_title\"> <span role=\"img\" aria-label=\"Notification undefined\" class=\"o_icon fa fa-3x fa-lightbulb-o\" title=\"Notification undefined\"></span> a </div> <div class=\"o_notification_content\">b</div>",
"<div class=\"o_notification_title\"> <span aria-label=\"Notification\" role=\"img\" class=\"o_icon fa fa-3x fa-lightbulb-o\" title=\"Notification\"></span> a </div> <div class=\"o_notification_content\">b</div>",
"should display notification");
assert.containsNone($notification, '.o_close', "should not display the close button in ");
await testUtils.nextTick();
@@ -73,7 +73,7 @@ QUnit.module('Services', {
await testUtils.nextMicrotaskTick();
var $notification = $('body .o_notification_manager .o_notification');
assert.strictEqual(_.str.trim($notification.html().replace(/\s+/g, ' ')),
"<div class=\"o_notification_title\"> <span role=\"img\" aria-label=\"Notification undefined\" class=\"o_icon fa fa-3x fa-exclamation\" title=\"Notification undefined\"></span> a </div> <div class=\"o_notification_content\">b</div>",
"<div class=\"o_notification_title\"> <span aria-label=\"Notification\" role=\"img\" class=\"o_icon fa fa-3x fa-exclamation\" title=\"Notification\"></span> a </div> <div class=\"o_notification_content\">b</div>",
"should display notification");
view.destroy();
});
@@ -180,7 +180,7 @@ QUnit.module('Services', {
assert.containsOnce($notification.eq(0), '.o_close',
"should display the close button in notification");
assert.strictEqual(_.str.trim($notification.eq(0).html().replace(/\s+/g, ' ')),
"<a aria-label=\"Close\" class=\"fa fa-times o_close\" href=\"#\" title=\"Close\"></a> <div class=\"o_notification_title\"> <span role=\"img\" aria-label=\"Notification undefined\" class=\"o_icon fa fa-3x fa-question-circle-o\" title=\"Notification undefined\"></span> a0 </div> <div class=\"o_notification_content\">b0</div> <div class=\"o_buttons\"> <button class=\"btn btn-primary\" type=\"button\"> <span>accept0</span> </button><button class=\"btn btn-secondary\" type=\"button\"> <span>refuse0</span> </button> </div>",
"<a aria-label=\"Close\" class=\"fa fa-times o_close\" href=\"#\" title=\"Close\"></a> <div class=\"o_notification_title\"> <span aria-label=\"Notification\" role=\"img\" class=\"o_icon fa fa-3x fa-question-circle-o\" title=\"Notification\"></span> a0 </div> <div class=\"o_notification_content\">b0</div> <div class=\"o_buttons\"> <button class=\"btn btn-primary\" type=\"button\"> <span>accept0</span> </button><button class=\"btn btn-secondary\" type=\"button\"> <span>refuse0</span> </button> </div>",
"should display notification");

testUtils.dom.click($notification.find('.o_buttons button:contains(accept0)'));
@@ -334,8 +334,9 @@
<input class="d-none link-style" name="link_style_color" type="radio" value=""/>
<i class="fa"/>
</label>
<t t-set="title">Color for</t>
<t t-foreach="['alpha', 'beta', 'gamma', 'delta', 'epsilon', 'primary', 'secondary', 'success', 'info', 'warning', 'danger']" t-as="color">
<label role="button" t-attf-class="o_link_dialog_color_item o_btn_preview btn btn-#{color}" t-attf-aria-label="Color for #{color}" t-attf-title="Color for #{color}">
<label role="button" t-attf-class="o_link_dialog_color_item o_btn_preview btn btn-#{color}" t-attf-aria-label="#{title} #{color}" t-attf-title="#{title} #{color}">
<input type="radio" name="link_style_color" class="d-none link-style" t-att-value="color"/>
<i class="fa"/>
</label>
@@ -27,13 +27,19 @@
<t t-name="website.seo_keyword">
<tr class="js_seo_keyword" t-att-data-keyword="widget.keyword">
<td t-esc="widget.keyword"/>
<td class="text-center"><i t-if="widget.used_h1" class="fa fa-check" t-attf-title="{{ widget.keyword }} is used in page first level heading"/></td>
<td class="text-center"><i t-if="widget.used_h2" class="fa fa-check" t-attf-title="{{ widget.keyword }} is used in page second level heading"/></td>
<td class="text-center"><i class="js_seo_keyword_title fa fa-check" style="visibility: hidden;" t-attf-title="{{ widget.keyword }} is used in page title"/></td>
<td class="text-center"><i class="js_seo_keyword_description fa fa-check" style="visibility: hidden;" t-attf-title="{{ widget.keyword }} is used in page description"/></td>
<td class="text-center"><i t-if="widget.used_content" class="fa fa-check" t-attf-title="{{ widget.keyword }} is used in page content"/></td>
<t t-set="title">is used in page first level heading</t>
<td class="text-center"><i t-if="widget.used_h1" class="fa fa-check" t-attf-title="{{ widget.keyword }} {{ title }}"/></td>
<t t-set="title">is used in page second level heading</t>
<td class="text-center"><i t-if="widget.used_h2" class="fa fa-check" t-attf-title="{{ widget.keyword }} {{ title }}"/></td>
<t t-set="title">is used in page title</t>
<td class="text-center"><i class="js_seo_keyword_title fa fa-check" style="visibility: hidden;" t-attf-title="{{ widget.keyword }} {{ title }}"/></td>
<t t-set="title">is used in page description</t>
<td class="text-center"><i class="js_seo_keyword_description fa fa-check" style="visibility: hidden;" t-attf-title="{{ widget.keyword }} {{ title }}"/></td>
<t t-set="title">is used in page content</t>
<td class="text-center"><i t-if="widget.used_content" class="fa fa-check" t-attf-title="{{ widget.keyword }} {{ title }}"/></td>
<td class="js_seo_keyword_suggestion"/>
<td class="text-center"><a href="#" class="oe_remove" data-action="remove-keyword" t-attf-title="Remove {{ widget.keyword }}"><i class="fa fa-trash"/></a></td>
<t t-set="title">Remove</t>
<td class="text-center"><a href="#" class="oe_remove" data-action="remove-keyword" t-attf-title="{{ title }} {{ widget.keyword }}"><i class="fa fa-trash"/></a></td>
</tr>
</t>

@@ -1287,8 +1287,9 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
</td>
<td class="text-center">
<t t-set='date_formatted'><t t-options='{"widget": "date"}' t-esc="page.date_publish"/></t>
<t t-set="title">This page will be visible on</t>
<i t-if="page.is_visible" class="fa fa-check" title="Visible"/>
<i t-elif="page.website_published" class="fa fa-eye-slash" t-attf-title="This page will be visible on {{ date_formatted }}"/>
<i t-elif="page.website_published" class="fa fa-eye-slash" t-attf-title="#{title} {{ date_formatted }}"/>
<i t-else="" class="fa fa-times text-muted" title="Not visible"/>
</td>
<td class="text-center">
@@ -62,8 +62,9 @@
</button>
<p>Move this question to the top of the list by sharing it on social networks.</p><br/>
<div>
<t t-set="title">Share on</t>
<t t-foreach="medias" t-as="media">
<a style="cursor: pointer" t-attf-class="fa-stack fa-lg share oe_share_bump #{media}" t-attf-aria-label="Share on #{media}" t-attf-title="Share on #{media}">
<a style="cursor: pointer" t-attf-class="fa-stack fa-lg share oe_share_bump #{media}" t-attf-aria-label="#{title} #{media}" t-attf-title="#{title} #{media}">
<span class="fa fa-square fa-stack-2x"></span>
<span t-attf-class="oe_social_#{media} fa fa-#{media} fa-stack-1x fa-inverse"></span>
</a>

0 comments on commit 092e987

Please sign in to comment.
You can’t perform that action at this time.