Merge lp:~tsabi/openerp-web/openerp-web-saas-4-translation-fixes into lp:~openerp/openerp-web/saas-4

Proposed by Csaba TOTH
Status: Needs review
Proposed branch: lp:~tsabi/openerp-web/openerp-web-saas-4-translation-fixes
Merge into: lp:~openerp/openerp-web/saas-4
Diff against target: 1024 lines (+173/-165)
10 files modified
addons/web/static/src/js/chrome.js (+9/-6)
addons/web/static/src/js/data.js (+26/-24)
addons/web/static/src/js/formats.js (+1/-1)
addons/web/static/src/js/openerpframework.js (+18/-18)
addons/web/static/src/js/view_form.js (+22/-22)
addons/web/static/src/js/view_list_editable.js (+3/-3)
addons/web_diagram/static/src/js/diagram.js (+32/-29)
addons/web_gantt/static/src/js/gantt.js (+8/-8)
addons/web_kanban/static/src/js/kanban.js (+6/-6)
addons/web_view_editor/static/src/js/view_editor.js (+48/-48)
To merge this branch: bzr merge lp:~tsabi/openerp-web/openerp-web-saas-4-translation-fixes
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+217843@code.launchpad.net

Description of the change

check of every js file for missing translations

it seems my editor eliminated every ending whitespaces and converted tabs to spaces.. sorry about that.

To post a comment you must log in.

Unmerged revisions

3992. By Csaba TOTH

recheck every js file for missing translations

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/chrome.js'
2--- addons/web/static/src/js/chrome.js 2014-04-16 12:00:34 +0000
3+++ addons/web/static/src/js/chrome.js 2014-04-30 23:03:44 +0000
4@@ -181,7 +181,7 @@
5 if (this.dialog_inited) {
6 this.trigger("closing", reason);
7 if (this.$el.is(":data(bs.modal)")) { // may have been destroyed by closing signal
8- this.$el.parents('.modal').modal('hide');
9+ this.$el.parents('.modal').modal('hide');
10 }
11 }
12 },
13@@ -236,7 +236,7 @@
14 return;
15 }
16 if (error.data.name === "openerp.http.SessionExpiredException" || error.data.name === "werkzeug.exceptions.Forbidden") {
17- this.show_warning({type: "Session Expired", data: { message: _t("Your OpenERP session expired. Please refresh the current web page.") }});
18+ this.show_warning({type: _t("Session Expired"), data: { message: _t("Your OpenERP session expired. Please refresh the current web page.") }});
19 return;
20 }
21 if (error.data.exception_type === "except_osv" || error.data.exception_type === "warning"
22@@ -255,7 +255,7 @@
23 }
24 new instance.web.Dialog(this, {
25 size: 'medium',
26- title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"),
27+ title: "OpenERP " + (_.str.capitalize(error.type) || _t("Warning")),
28 buttons: [
29 {text: _t("Ok"), click: function() { this.parents('.modal').modal('hide'); }}
30 ],
31@@ -321,7 +321,7 @@
32
33 new instance.web.Dialog(this, {
34 size: 'medium',
35- title: "OpenERP " + (_.str.capitalize(error.type) || "Warning"),
36+ title: "OpenERP " + (_.str.capitalize(error.type) || _t("Warning")),
37 buttons: [
38 {text: _t("Ok"), click: function() { this.$el.parents('.modal').modal('hide'); }},
39 {text: error.data.arguments[2], click: function() {
40@@ -491,7 +491,10 @@
41 if (result) {
42 instance.web.redirect('/web');
43 } else {
44- alert("Failed to create database");
45+ self.display_error({
46+ title: _t("Creating Database"),
47+ error: _t("Failed to create database")
48+ });
49 }
50 });
51 },
52@@ -537,7 +540,7 @@
53 if(error){
54 self.display_error({
55 title: _t("Backup Database"),
56- error: 'AccessDenied'
57+ error: _t('Access Denied')
58 });
59 }
60 },
61
62=== modified file 'addons/web/static/src/js/data.js'
63--- addons/web/static/src/js/data.js 2014-04-08 09:08:52 +0000
64+++ addons/web/static/src/js/data.js 2014-04-30 23:03:44 +0000
65@@ -4,6 +4,8 @@
66 var instance = openerp;
67 openerp.web.data = {};
68
69+var _t = instance.web._t;
70+
71 /**
72 * Serializes the sort criterion array of a dataset into a form which can be
73 * consumed by OpenERP's RPC APIs.
74@@ -184,7 +186,7 @@
75 * Creates a new query with the provided parameter lazy replacing the current
76 * query's own.
77 *
78- * @param {Boolean} lazy indicates if the read_group should return only the
79+ * @param {Boolean} lazy indicates if the read_group should return only the
80 * first level of groupby records, or should return the records grouped by
81 * all levels at once (so, it makes only 1 db request).
82 * @returns {openerp.web.Query}
83@@ -255,11 +257,11 @@
84 var group_size = fixed_group[count_key] || fixed_group.__count || 0;
85 var leaf_group = fixed_group.__context.group_by.length === 0;
86
87- var value = (grouping_fields.length === 1)
88+ var value = (grouping_fields.length === 1)
89 ? fixed_group[grouping_fields[0]]
90 : _.map(grouping_fields, function (field) { return fixed_group[field]; });
91- var grouped_on = (grouping_fields.length === 1)
92- ? grouping_fields[0]
93+ var grouped_on = (grouping_fields.length === 1)
94+ ? grouping_fields[0]
95 : grouping_fields;
96 this.attributes = {
97 folded: !!(fixed_group.__fold),
98@@ -290,7 +292,7 @@
99
100 @constructs instance.web.Model
101 @extends instance.web.Class
102-
103+
104 @param {openerp.web.Session} [session] The session object used to communicate with
105 the server.
106 @param {String} model_name name of the OpenERP model this object is bound to
107@@ -478,7 +480,7 @@
108 read_ids: function (ids, fields, options) {
109 if (_.isEmpty(ids))
110 return $.Deferred().resolve([]);
111-
112+
113 options = options || {};
114 var method = 'read';
115 var ids_arg = ids;
116@@ -631,7 +633,7 @@
117 return this._model.call('name_get', [ids], {context: this.get_context()});
118 },
119 /**
120- *
121+ *
122 * @param {String} name name to perform a search for/on
123 * @param {Array} [domain=[]] filters for the objects returned, OpenERP domain
124 * @param {String} [operator='ilike'] matching operator to use with the provided name value
125@@ -935,7 +937,7 @@
126 // sorting an array where all items are considered equal is a worst-case that
127 // will randomize the array with an unstable sort! Therefore we must avoid
128 // sorting if there are no sort_fields (i.e. all items are considered equal)
129- // See also: http://ecma262-5.com/ELS5_Section_15.htm#Section_15.4.4.11
130+ // See also: http://ecma262-5.com/ELS5_Section_15.htm#Section_15.4.4.11
131 // http://code.google.com/p/v8/issues/detail?id=90
132 if (sort_fields.length) {
133 records.sort(function (a, b) {
134@@ -1166,12 +1168,12 @@
135 });
136
137 instance.web.SimpleIndexedDB = instance.web.Class.extend({
138- /**
139- * A simple wrapper around IndexedDB that provides an asynchronous
140- * localStorage-like Key-Value api that persists between browser
141+ /**
142+ * A simple wrapper around IndexedDB that provides an asynchronous
143+ * localStorage-like Key-Value api that persists between browser
144 * restarts.
145 *
146- * It will not work if the browser doesn't support a recent version
147+ * It will not work if the browser doesn't support a recent version
148 * of IndexedDB, and it may fail if the user refuses db access.
149 *
150 * All instances of SimpleIndexedDB will by default refer to the same
151@@ -1207,13 +1209,13 @@
152 };
153 }else{
154 this.db = null;
155- this._ready.reject({type:'UnknownError', message:'IndexedDB is not supported by your Browser'});
156+ this._ready.reject({type:'UnknownError', message:_t('IndexedDB is not supported by your Browser')});
157 }
158 },
159
160 /**
161- * returns true if the browser supports the necessary IndexedDB API
162- * (but doesn't tell if the db can be created, check ready() for that)
163+ * returns true if the browser supports the necessary IndexedDB API
164+ * (but doesn't tell if the db can be created, check ready() for that)
165 */
166 isSupportedByBrowser: function(){
167 return this.indexedDB && this.indexedDB.open;
168@@ -1230,7 +1232,7 @@
169
170 /**
171 * fetches the value associated to 'key' in the db. if the key doesn't
172- * exists, it returns undefined. The returned value is provided as a
173+ * exists, it returns undefined. The returned value is provided as a
174 * deferred, or as the first parameter of the optional 'done' callback.
175 */
176 getItem: function(key,done,failed){
177@@ -1247,16 +1249,16 @@
178 def.resolve(request.result ? request.result.value : undefined);
179 };
180
181- request.onerror = function(event){
182+ request.onerror = function(event){
183 def.reject(event.target.error);
184 };
185 },function(){
186- def.reject({type:'UnknownError', message:'Could not initialize the IndexedDB database'});
187+ def.reject({type:'UnknownError', message:_t('Could not initialize the IndexedDB database')});
188 });
189
190 return def.promise();
191 },
192-
193+
194 /**
195 * Associates a value to 'key' in the db, overwriting previous value if
196 * necessary. Contrary to localStorage, the value is not limited to strings and
197@@ -1278,18 +1280,18 @@
198 def.resolve();
199 };
200
201- request.onerror = function(event){
202+ request.onerror = function(event){
203 def.reject(event.target.error);
204 };
205 },function(){
206- def.reject({type:'UnknownError', message:'Could not initialize the IndexedDB database'});
207+ def.reject({type:'UnknownError', message:_t('Could not initialize the IndexedDB database')});
208 });
209
210 return def.promise();
211 },
212
213 /**
214- * Removes the value associated with 'key' from the db.
215+ * Removes the value associated with 'key' from the db.
216 */
217 removeItem: function(key,done,failed){
218 var self = this;
219@@ -1305,11 +1307,11 @@
220 def.resolve();
221 };
222
223- request.onerror = function(event){
224+ request.onerror = function(event){
225 def.reject(event.target.error);
226 };
227 },function(){
228- def.reject({type:'UnknownError', message:'Could not initialize the IndexedDB database'});
229+ def.reject({type:'UnknownError', message:_t('Could not initialize the IndexedDB database')});
230 });
231
232 return def.promise();
233
234=== modified file 'addons/web/static/src/js/formats.js'
235--- addons/web/static/src/js/formats.js 2014-02-18 16:21:25 +0000
236+++ addons/web/static/src/js/formats.js 2014-04-30 23:03:44 +0000
237@@ -330,7 +330,7 @@
238 if(!value){
239 return 0;
240 }else if(!precision){
241- throw new Error('round_precision(...): Cannot round value: '+value+' with a precision of zero (or undefined)');
242+ throw new Error(_.str.sprintf(_t("round_precision(...): Cannot round value: '%s' with a precision of zero (or undefined)"), value));
243 }
244 var normalized_value = value / precision;
245 var epsilon_magnitude = Math.log(Math.abs(normalized_value))/Math.log(2);
246
247=== modified file 'addons/web/static/src/js/openerpframework.js'
248--- addons/web/static/src/js/openerpframework.js 2014-01-31 00:52:02 +0000
249+++ addons/web/static/src/js/openerpframework.js 2014-04-30 23:03:44 +0000
250@@ -645,7 +645,7 @@
251 * Method called after rendering. Mostly used to bind actions, perform asynchronous
252 * calls, etc...
253 *
254- * By convention, this method should return an object that can be passed to $.when()
255+ * By convention, this method should return an object that can be passed to $.when()
256 * to inform the caller when this widget has been initialized.
257 *
258 * @returns {jQuery.Deferred or any}
259@@ -955,12 +955,12 @@
260 },
261 /**
262 @constructs openerp.Session
263-
264+
265 @param parent The parent of the newly created object.
266 @param {String} origin Url of the OpenERP server to contact with this session object
267 or `null` if the server to contact is the origin server.
268 @param {Dict} options A dictionary that can contain the following options:
269-
270+
271 * "override_session": Default to false. If true, the current session object will
272 not try to re-use a previously created session id stored in a cookie.
273 * "session_id": Default to null. If specified, the specified session_id will be used
274@@ -1131,7 +1131,7 @@
275 qs = "?" + qs;
276 var prefix = _.any(['http://', 'https://', '//'], function(el) {
277 return path.length >= el.length && path.slice(0, el.length) === el;
278- }) ? '' : this.prefix;
279+ }) ? '' : this.prefix;
280 return prefix + path + qs;
281 },
282 model: function(model_name) {
283@@ -1145,7 +1145,7 @@
284
285 @constructs instance.Model
286 @extends instance.Class
287-
288+
289 @param {openerp.Session} [session] The session object used to communicate with
290 the server.
291 @param {String} model_name name of the OpenERP model this object is bound to
292@@ -1169,7 +1169,7 @@
293 },
294 session: function() {
295 if (! this._session)
296- throw new Error("Not session specified");
297+ throw new Error("No session specified");
298 return this._session;
299 },
300 /**
301@@ -1310,10 +1310,10 @@
302 /**
303 * Converts a string to a Date javascript object using OpenERP's
304 * datetime string format (exemple: '2011-12-01 15:12:35.832').
305- *
306+ *
307 * The time zone is assumed to be UTC (standard for OpenERP 6.1)
308 * and will be converted to the browser's time zone.
309- *
310+ *
311 * @param {String} str A string representing a datetime.
312 * @returns {Date}
313 */
314@@ -1344,11 +1344,11 @@
315 /**
316 * Converts a string to a Date javascript object using OpenERP's
317 * date string format (exemple: '2011-12-01').
318- *
319+ *
320 * As a date is not subject to time zones, we assume it should be
321 * represented as a Date javascript object at 00:00:00 in the
322 * time zone of the browser.
323- *
324+ *
325 * @param {String} str A string representing a date.
326 * @returns {Date}
327 */
328@@ -1374,11 +1374,11 @@
329 /**
330 * Converts a string to a Date javascript object using OpenERP's
331 * time string format (exemple: '15:12:35').
332- *
333+ *
334 * The OpenERP times are supposed to always be naive times. We assume it is
335 * represented using a javascript Date with a date 1 of January 1970 and a
336 * time corresponding to the meant time in the browser's time zone.
337- *
338+ *
339 * @param {String} str A string representing a time.
340 * @returns {Date}
341 */
342@@ -1423,10 +1423,10 @@
343 /**
344 * Converts a Date javascript object to a string using OpenERP's
345 * datetime string format (exemple: '2011-12-01 15:12:35').
346- *
347+ *
348 * The time zone of the Date object is assumed to be the one of the
349 * browser and it will be converted to UTC (standard for OpenERP 6.1).
350- *
351+ *
352 * @param {Date} obj
353 * @returns {String} A string representing a datetime.
354 */
355@@ -1442,11 +1442,11 @@
356 /**
357 * Converts a Date javascript object to a string using OpenERP's
358 * date string format (exemple: '2011-12-01').
359- *
360+ *
361 * As a date is not subject to time zones, we assume it should be
362 * represented as a Date javascript object at 00:00:00 in the
363 * time zone of the browser.
364- *
365+ *
366 * @param {Date} obj
367 * @returns {String} A string representing a date.
368 */
369@@ -1461,11 +1461,11 @@
370 /**
371 * Converts a Date javascript object to a string using OpenERP's
372 * time string format (exemple: '15:12:35').
373- *
374+ *
375 * The OpenERP times are supposed to always be naive times. We assume it is
376 * represented using a javascript Date with a date 1 of January 1970 and a
377 * time corresponding to the meant time in the browser's time zone.
378- *
379+ *
380 * @param {Date} obj
381 * @returns {String} A string representing a time.
382 */
383
384=== modified file 'addons/web/static/src/js/view_form.js'
385--- addons/web/static/src/js/view_form.js 2014-04-24 13:18:24 +0000
386+++ addons/web/static/src/js/view_form.js 2014-04-30 23:03:44 +0000
387@@ -581,7 +581,7 @@
388 if (!field) { return; }
389 field.node.attrs.domain = domain;
390 });
391-
392+
393 if (result.value) {
394 this._internal_set_values(result.value, processed);
395 }
396@@ -2271,7 +2271,7 @@
397 /**
398 Some hack to make placeholders work in ie9.
399 */
400-if (!('placeholder' in document.createElement('input'))) {
401+if (!('placeholder' in document.createElement('input'))) {
402 document.addEventListener("DOMNodeInserted",function(event){
403 var nodename = event.target.nodeName.toLowerCase();
404 if ( nodename === "input" || nodename == "textarea" ) {
405@@ -2471,12 +2471,12 @@
406 var domain = instance.web.pyeval.eval('domain', this.get('value'));
407 var ds = new instance.web.DataSetStatic(self, model, self.build_context());
408 ds.call('search_count', [domain]).then(function (results) {
409- $('.oe_domain_count', self.$el).text(results + ' records selected');
410- $('button span', self.$el).text(' Change selection');
411+ $('.oe_domain_count', self.$el).text(_.str.sprintf(_t('%s records selected'), results));
412+ $('button span', self.$el).text(_t(' Change selection'));
413 });
414 } else {
415- $('.oe_domain_count', this.$el).text('0 record selected');
416- $('button span', this.$el).text(' Select records');
417+ $('.oe_domain_count', this.$el).text(_t('0 record selected'));
418+ $('button span', this.$el).text(_t(' Select records'));
419 };
420 this.$('.select_records').on('click', self.on_click);
421 },
422@@ -2485,7 +2485,7 @@
423 var model = this.options.model || this.field_manager.get_field_value(this.options.model_field);
424 this.pop = new instance.web.form.SelectCreatePopup(this);
425 this.pop.select_element(
426- model, {title: 'Select records...'},
427+ model, {title: _t('Select records...')},
428 [], this.build_context());
429 this.pop.on("elements_selected", self, function(element_ids) {
430 if (this.pop.$('input.oe_list_record_selector').prop('checked')) {
431@@ -2911,13 +2911,13 @@
432 .width(width)
433 .height(height)
434 .margin({top: 0, right: 0, bottom: 0, left: 0})
435- .donut(true)
436+ .donut(true)
437 .showLegend(false)
438 .showLabels(false)
439 .tooltips(false)
440 .color(['#7C7BAD','#DDD'])
441 .donutRatio(0.62);
442-
443+
444 d3.select(svg)
445 .datum([{'x': 'value', 'y': value}, {'x': 'complement', 'y': 100 - value}])
446 .transition()
447@@ -2932,7 +2932,7 @@
448
449 return chart;
450 });
451-
452+
453 }
454 });
455
456@@ -2959,7 +2959,7 @@
457 .transitionDuration(350)
458 .showXAxis(false)
459 .showYAxis(false);
460-
461+
462 d3.select(svg)
463 .datum([{key: 'values', values: value}])
464 .transition()
465@@ -2970,7 +2970,7 @@
466
467 return chart;
468 });
469-
470+
471 }
472 });
473
474@@ -3209,7 +3209,7 @@
475
476 /**
477 A mixin containing some useful methods to handle completion inputs.
478-
479+
480 The widget containing this option can have these arguments in its widget options:
481 - no_quick_create: if true, it will disable the quick create
482 */
483@@ -3493,7 +3493,7 @@
484 this.$drop_down.click(function() {
485 self.$input.focus();
486 if (self.$input.autocomplete("widget").is(":visible")) {
487- self.$input.autocomplete("close");
488+ self.$input.autocomplete("close");
489 } else {
490 if (self.get("value") && ! self.floating) {
491 self.$input.autocomplete("search", "");
492@@ -3632,7 +3632,7 @@
493 var dataset = new instance.web.DataSetStatic(this, this.field.relation, self.build_context());
494 this.alive(dataset.name_get([self.get("value")])).done(function(data) {
495 if (!data[0]) {
496- self.do_warn(_t("Render"), _t("No value found for the field "+self.field.string+" for value "+self.get("value")));
497+ self.do_warn(_t("Render"), _.str.sprintf(_t("No value found for the field '%s' for value '%s'"), self.field.string, self.get("value")));
498 return;
499 }
500 self.display_value["" + self.get("value")] = data[0][1];
501@@ -4611,12 +4611,12 @@
502 return input ? input.focus() : false;
503 },
504 set_dimensions: function (height, width) {
505- this._super(height, width);
506+ this._super(height, width);
507 this.$("textarea").css({
508 width: width,
509 minHeight: height
510 });
511- },
512+ },
513 _search_create_popup: function() {
514 self.ignore_blur = true;
515 return instance.web.form.CompletionFieldMixin._search_create_popup.apply(this, arguments);
516@@ -4752,7 +4752,7 @@
517 var self = this;
518 var pop = new instance.web.form.FormOpenPopup(this);
519 pop.show_element(this.dataset.model, id, this.m2m_field.build_context(), {
520- title: _t("Open: ") + this.m2m_field.string,
521+ title: _.str.sprintf(_t("Open: %s"), this.m2m_field.string),
522 readonly: this.getParent().get("effective_readonly")
523 });
524 pop.on('write_completed', self, self.reload_content);
525@@ -4865,7 +4865,7 @@
526 pop.select_element(
527 this.field.relation,
528 {
529- title: _t("Add: ") + this.string
530+ title: _.str.sprintf(_t("Add: %s"), this.string)
531 },
532 new instance.web.CompoundDomain(this.build_domain(), ["!", ["id", "in", this.dataset.ids]]),
533 this.build_context()
534@@ -4883,7 +4883,7 @@
535 var id = self.dataset.ids[self.dataset.index];
536 pop = new instance.web.form.FormOpenPopup(this);
537 pop.show_element(self.field.relation, id, self.build_context(), {
538- title: _t("Open: ") + self.string,
539+ title: _.str.sprintf(_t("Open: %s"), self.string),
540 write_function: function(id, data, options) {
541 return self.dataset.write(id, data, {}).done(function() {
542 self.render_value();
543@@ -5756,7 +5756,7 @@
544 render_value: function() {
545 var self = this;
546 var content = QWeb.render("FieldStatus.content", {
547- 'widget': self,
548+ 'widget': self,
549 'value_folded': _.find(self.selection.folded, function(i){return i[0] === self.get('value');})
550 });
551 self.$el.html(content);
552@@ -6027,7 +6027,7 @@
553
554 /**
555 This widget is intended to be used on stat button numeric fields. It will display
556- the value many2many and one2many. It is a read-only field that will
557+ the value many2many and one2many. It is a read-only field that will
558 display a simple string "<value of field> <label of the field>"
559 */
560 instance.web.form.StatInfo = instance.web.form.AbstractField.extend({
561
562=== modified file 'addons/web/static/src/js/view_list_editable.js'
563--- addons/web/static/src/js/view_list_editable.js 2014-04-09 09:36:16 +0000
564+++ addons/web/static/src/js/view_list_editable.js 2014-04-30 23:03:44 +0000
565@@ -396,7 +396,7 @@
566 this.trigger(event_name + ':before', event);
567 if (event.cancel) {
568 return $.Deferred().reject({
569- message: _.str.sprintf("Event %s:before cancelled",
570+ message: _.str.sprintf(_t("Event %s:before cancelled"),
571 event_name)});
572 }
573 return $.when(action.call(this)).done(function () {
574@@ -467,7 +467,7 @@
575 self.resize_field(item.field, item.cell);
576 }, 0);
577 }
578-
579+
580 });
581 });
582
583@@ -697,7 +697,7 @@
584 },
585 start: function () {
586 var self = this;
587- var _super = this._super();
588+ var _super = this._super();
589 this.form.embedded_view = this._validate_view(
590 this.delegate.edition_view(this));
591 var form_ready = this.form.appendTo(this.$el).done(
592
593=== modified file 'addons/web_diagram/static/src/js/diagram.js'
594--- addons/web_diagram/static/src/js/diagram.js 2014-04-10 10:06:31 +0000
595+++ addons/web_diagram/static/src/js/diagram.js 2014-04-30 23:03:44 +0000
596@@ -160,14 +160,14 @@
597 node_size_y: 80,
598 connector_active_color: "#FFF",
599 connector_radius: 4,
600-
601+
602 close_button_radius: 8,
603 close_button_color: "#333",
604 close_button_x_color: "#FFF",
605
606 gray: "#DCDCDC",
607 white: "#FFF",
608-
609+
610 viewport_margin: 50
611 };
612
613@@ -243,14 +243,14 @@
614 node_id,
615 self.context || self.dataset.context,
616 {
617- title: _t("Open: ") + title
618+ title: _.str.sprintf(_t("Open: %s"), title)
619 }
620 );
621
622 pop.on('write_completed', self, function() {
623 self.dataset.read_index(_.keys(self.fields_view.fields)).then(self.on_diagram_loaded);
624 });
625-
626+
627 var form_fields = [self.parent_field];
628 var form_controller = pop.view_form;
629
630@@ -263,7 +263,7 @@
631 });
632 });
633
634-
635+
636 },
637
638 // Creates a popup to add a node to the diagram
639@@ -274,7 +274,7 @@
640 pop.select_element(
641 self.node,
642 {
643- title: _t("Create:") + title,
644+ title: _.str.sprintf(_t("Create: %s"), title),
645 initial_view: 'form',
646 disable_multiple_selection: true
647 },
648@@ -308,7 +308,7 @@
649 parseInt(connector_id,10), //FIXME Isn't connector_id supposed to be an int ?
650 self.context || self.dataset.context,
651 {
652- title: _t("Open: ") + title
653+ title: _.str.sprintf(_t("Open: %s"), title)
654 }
655 );
656 pop.on('write_completed', self, function() {
657@@ -326,7 +326,7 @@
658 pop.select_element(
659 self.connector,
660 {
661- title: _t("Create:") + title,
662+ title: _.str.sprintf(_t("Create: %s"), title),
663 initial_view: 'form',
664 disable_multiple_selection: true
665 },
666@@ -354,19 +354,19 @@
667 form_controller.fields[self.connectors.attrs.destination].dirty = true;
668 });
669 },
670-
671+
672 do_hide: function () {
673 if (this.$pager) {
674 this.$pager.hide();
675 }
676 this._super();
677 },
678-
679+
680 init_pager: function() {
681 var self = this;
682 if (this.$pager)
683 this.$pager.remove();
684-
685+
686 this.$pager = $(QWeb.render("DiagramView.pager", {'widget':self})).hide();
687 if (this.options.$pager) {
688 this.$pager.appendTo(this.options.$pager);
689@@ -379,30 +379,30 @@
690 });
691 this.do_update_pager();
692 },
693-
694+
695 pager_action_trigger: function(){
696 var loaded = this.dataset.read_index(_.keys(this.fields_view.fields))
697 .then(this.on_diagram_loaded);
698 this.do_update_pager();
699 return loaded;
700 },
701-
702+
703 execute_pager_action: function(action) {
704- switch (action) {
705- case 'first':
706- this.dataset.index = 0;
707- break;
708- case 'previous':
709- this.dataset.previous();
710- break;
711- case 'next':
712- this.dataset.next();
713- break;
714- case 'last':
715- this.dataset.index = this.dataset.ids.length - 1;
716- break;
717- }
718- this.trigger('pager_action_executed');
719+ switch (action) {
720+ case 'first':
721+ this.dataset.index = 0;
722+ break;
723+ case 'previous':
724+ this.dataset.previous();
725+ break;
726+ case 'next':
727+ this.dataset.next();
728+ break;
729+ case 'last':
730+ this.dataset.index = this.dataset.ids.length - 1;
731+ break;
732+ }
733+ this.trigger('pager_action_executed');
734
735 },
736
737@@ -411,7 +411,10 @@
738 if (hide_index) {
739 $(".oe_diagram_pager_state", this.$pager).html("");
740 } else {
741- $(".oe_diagram_pager_state", this.$pager).html(_.str.sprintf(_t("%d / %d"), this.dataset.index + 1, this.dataset.ids.length));
742+ $(".oe_diagram_pager_state", this.$pager).html(_.str.sprintf(_t("%(num)d / %(length)d"), {
743+ num: this.dataset.index + 1,
744+ length: this.dataset.ids.length
745+ }));
746 }
747 },
748
749
750=== modified file 'addons/web_gantt/static/src/js/gantt.js'
751--- addons/web_gantt/static/src/js/gantt.js 2013-03-05 08:27:08 +0000
752+++ addons/web_gantt/static/src/js/gantt.js 2014-04-30 23:03:44 +0000
753@@ -48,7 +48,7 @@
754 return self.fields_view.arch.attrs[key] || '';
755 }));
756 fields = _.uniq(fields.concat(n_group_bys));
757-
758+
759 return $.when(this.has_been_loaded).then(function() {
760 return self.dataset.read_slice(fields, {
761 domain: domains,
762@@ -67,7 +67,7 @@
763 var ids = _.pluck(tasks, "id");
764 return this.dataset.name_get(ids).then(function(names) {
765 var ntasks = _.map(tasks, function(task) {
766- return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task);
767+ return _.extend({__name: _.detect(names, function(name) { return name[0] == task.id; })[1]}, task);
768 });
769 return self.on_data_loaded_2(ntasks, group_bys);
770 });
771@@ -84,11 +84,11 @@
772 if (group_bys.length == 0) {
773 group_bys = ["_pseudo_group_by"];
774 _.each(tasks, function(el) {
775- el._pseudo_group_by = "Gantt View";
776+ el._pseudo_group_by = _t("Gantt View");
777 });
778 this.fields._pseudo_group_by = {type: "string"};
779 }
780-
781+
782 // get the groups
783 var split_groups = function(tasks, group_bys) {
784 if (group_bys.length === 0)
785@@ -109,7 +109,7 @@
786 return groups;
787 }
788 var groups = split_groups(tasks, group_bys);
789-
790+
791 // track ids of task items for context menu
792 var task_ids = {};
793 // creation of the chart
794@@ -185,7 +185,7 @@
795 self.on_task_changed(task);
796 });
797 gantt.create(this.chart_id);
798-
799+
800 // bind event to display task when we click the item in the tree
801 $(".taskNameItem", self.$el).click(function(event) {
802 var task_info = task_ids[event.target.id];
803@@ -193,7 +193,7 @@
804 self.on_task_display(task_info.internal_task);
805 }
806 });
807- if (this.is_action_enabled('create')) {
808+ if (this.is_action_enabled('create')) {
809 // insertion of create button
810 var td = $($("table td", self.$el)[0]);
811 var rendered = QWeb.render("GanttView-create-button");
812@@ -213,7 +213,7 @@
813 data[self.fields_view.arch.attrs.date_start] =
814 instance.web.auto_date_to_str(start, self.fields[self.fields_view.arch.attrs.date_start].type);
815 if (self.fields_view.arch.attrs.date_stop) {
816- data[self.fields_view.arch.attrs.date_stop] =
817+ data[self.fields_view.arch.attrs.date_stop] =
818 instance.web.auto_date_to_str(end, self.fields[self.fields_view.arch.attrs.date_stop].type);
819 } else { // we assume date_duration is defined
820 data[self.fields_view.arch.attrs.date_delay] = duration;
821
822=== modified file 'addons/web_kanban/static/src/js/kanban.js'
823--- addons/web_kanban/static/src/js/kanban.js 2014-03-05 11:33:07 +0000
824+++ addons/web_kanban/static/src/js/kanban.js 2014-04-30 23:03:44 +0000
825@@ -372,7 +372,7 @@
826 over: function(event, ui) {
827 var parent = $(event.target).parent();
828 prev_widget.highlight(false);
829- is_folded = parent.hasClass('oe_kanban_group_folded');
830+ is_folded = parent.hasClass('oe_kanban_group_folded');
831 if (is_folded) {
832 var widget = parent.data('widget');
833 widget.highlight(true);
834@@ -462,7 +462,7 @@
835 }
836 }).fail(function(error, evt) {
837 evt.preventDefault();
838- alert(_t("An error has occured while moving the record to this group: ") + error.data.message);
839+ alert(_.str.sprintf(_t("An error has occured while moving the record to this group: %s"), error.data.message));
840 self.do_reload(); // TODO: use draggable + sortable in order to cancel the dragging when the rcp fails
841 });
842 }
843@@ -485,7 +485,7 @@
844 if (this.dataset.select_id(id)) {
845 this.do_switch_view('form', null, { mode: editable ? "edit" : undefined });
846 } else {
847- this.do_warn("Kanban: could not find id#" + id);
848+ this.do_warn(_.str.sprintf(_t("Kanban: could not find id#%s"), id));
849 }
850 },
851 no_result: function() {
852@@ -960,7 +960,7 @@
853 } else if (typeof self[method] === 'function') {
854 self[method]($action);
855 } else {
856- self.do_warn("Kanban: no action for type : " + type);
857+ self.do_warn(_.str.sprintf(_t("Kanban: no action for type : %s"), type));
858 }
859 });
860
861@@ -1143,7 +1143,7 @@
862 */
863 instance.web_kanban.QuickCreate = instance.web.Widget.extend({
864 template: 'KanbanView.quick_create',
865-
866+
867 /**
868 * close_btn: If true, the widget will display a "Close" button able to trigger
869 * a "close" event.
870@@ -1208,7 +1208,7 @@
871 pop.select_element(
872 self._dataset.model,
873 {
874- title: _t("Create: ") + (this.string || this.name),
875+ title: _.str.sprintf(_t("Create: %s"), this.string || this.name),
876 initial_view: "form",
877 disable_multiple_selection: true
878 },
879
880=== modified file 'addons/web_view_editor/static/src/js/view_editor.js'
881--- addons/web_view_editor/static/src/js/view_editor.js 2014-04-11 12:27:53 +0000
882+++ addons/web_view_editor/static/src/js/view_editor.js 2014-04-30 23:03:44 +0000
883@@ -543,10 +543,10 @@
884 },
885 inject_position : function(parent_tag,current_tag){
886 if(parent_tag == "view")
887- return ['Inside'];
888+ return [_t('Inside')];
889 if(current_tag == "field")
890- return ['After','Before'];
891- return ['After','Before','Inside'];
892+ return [_t('After'),_t('Before')];
893+ return [_t('After'),_t('Before'),_t('Inside')];
894 },
895 do_node_edit: function(side) {
896 var self = this;
897@@ -719,18 +719,18 @@
898 });
899 after_append = (after_append)?_.last(after_append.value):self.one_object.clicked_tr_id;
900 switch (update_values[1]) {
901- case "After":
902+ case _t("After"):
903 self.edit_xml_dialog.$el.
904 find("tr[id='viewedit-"+after_append+"']").after(clone);
905 $(arch1).after($(update_values[0]));
906 child_list.splice(index + 1, 0, object_xml);
907 break;
908- case "Before":
909+ case _t("Before"):
910 tr_click.before(clone);
911 $(arch1).before($(update_values[0]));
912 child_list.splice(index - 1, 0, object_xml);
913 break;
914- case "Inside":
915+ case _t("Inside"):
916 if (tr_click.find("img[id^='parentimg-']").length == 0) {
917 ($(tr_click.find('a').parent()).siblings('td'))
918 .append($('<img width="16" height="16"></img>').attr('src', '/web/static/src/img/collapse.gif').
919@@ -851,45 +851,45 @@
920 ]
921 }).open();
922 var _PROPERTIES_ATTRIBUTES = {
923- 'name' : {'name':'name', 'string': 'Name', 'type': 'char'},
924- 'string' : {'name':'string', 'string': 'String', 'type': 'char'},
925- 'required' : {'name':'required', 'string': 'Required', 'type': 'boolean'},
926- 'readonly' : {'name':'readonly', 'string': 'Readonly', 'type': 'boolean'},
927- 'invisible' : {'name':'invisible', 'string': 'Invisible', 'type': 'boolean'},
928- 'domain' : {'name':'domain', 'string': 'Domain', 'type': 'char'},
929- 'context' : {'name':'context', 'string': 'Context', 'type': 'char'},
930- 'limit' : {'name':'limit', 'string': 'Limit', 'type': 'float'},
931- 'min_rows' : {'name':'min_rows', 'string': 'Minimum rows', 'type': 'float'},
932- 'date_start' : {'name':'date_start', 'string': 'Start date', 'type': 'char'},
933- 'date_delay' : {'name':'date_delay', 'string': 'Delay date', 'type': 'char'},
934- 'day_length' : {'name':'day_length', 'string': 'Day length', 'type': 'char'},
935- 'mode' : {'name':'mode', 'string': 'Mode', 'type': 'char'},
936- 'align' : {'name':'align', 'string': 'Alignment ', 'type': 'selection', 'selection': [['', ''], ['0.0', 'Left'], ['0.5', 'Center'], ['1.0', 'Right']]},
937- 'icon' : {'name':'icon', 'string': 'Icon', 'type': 'selection', 'selection': _ICONS},
938- 'type' : {'name':'type', 'string': 'Type', 'type': 'selection', 'selection': [['', ''], ['action', 'Action'], ['object', 'Object'], ['workflow', 'Workflow'], ['server_action', 'Server Action']]},
939- 'special' : {'name':'special', 'string': 'Special', 'type': 'selection', 'selection': [['',''],['save', 'Save Button'], ['cancel', 'Cancel Button'], ['open', 'Open Button']]},
940- 'target' : {'name':'target', 'string': 'Target', 'type': 'selection', 'selection': [['', ''], ['new', 'New Window']]},
941- 'confirm' : {'name':'confirm', 'string': 'Confirm', 'type': 'char'},
942- 'style' : {'name':'style', 'string': 'Style', 'type': 'selection', 'selection':[["",""],["1", "1"],["1-1", "1-1"],["1-2", "1-2"],["2-1", "2-1"],["1-1-1", "1-1-1"]]},
943- 'filename' : {'name':'filename', 'string': 'File Name', 'type': 'char'},
944- 'width' : {'name':'width', 'string': 'Width', 'type': 'float'},
945- 'height' : {'name':'height', 'string': 'Height', 'type': 'float'},
946- 'attrs' : {'name':'attrs', 'string': 'Attrs', 'type': 'char'},
947- 'col' : {'name':'col', 'string': 'col', 'type': 'float'},
948- 'link' : {'name':'link', 'string': 'Link', 'type': 'char'},
949- 'position' : {'name':'position', 'string': 'Position', 'type': 'selection', 'selection': [['',''],['after', 'After'],['before', 'Before'],['inside', 'Inside'],['replace', 'Replace']]},
950- 'states' : {'name':'states', 'string': 'states', 'type': 'char'},
951- 'eval' : {'name':'eval', 'string': 'Eval', 'type': 'char'},
952- 'ref' : {'name':'ref', 'string': 'Ref', 'type': 'char'},
953- 'on_change' : {'name':'on_change', 'string': 'On change', 'type': 'char'},
954- 'nolabel' : {'name':'nolabel', 'string': 'No label', 'type': 'boolean'},
955- 'completion' : {'name':'completion', 'string': 'Completion', 'type': 'boolean'},
956- 'colspan' : {'name':'colspan', 'string': 'Colspan', 'type': 'float'},
957- 'widget' : {'name':'widget', 'string': 'widget', 'type': 'selection'},
958- 'colors' : {'name':'colors', 'string': 'Colors', 'type': 'char'},
959- 'editable' : {'name':'editable', 'string': 'Editable', 'type': 'selection', 'selection': [["",""],["top","Top"],["bottom", "Bottom"]]},
960- 'groups' : {'name':'groups', 'string': 'Groups', 'type': 'selection_multi'},
961- 'fonts' : {'name':'fonts', 'string': 'fonts', 'type': 'char'},
962+ 'name' : {'name':'name', 'string': _t('Name'), 'type': 'char'},
963+ 'string' : {'name':'string', 'string': _t('String'), 'type': 'char'},
964+ 'required' : {'name':'required', 'string': _t('Required'), 'type': 'boolean'},
965+ 'readonly' : {'name':'readonly', 'string': _t('Readonly'), 'type': 'boolean'},
966+ 'invisible' : {'name':'invisible', 'string': _t('Invisible'), 'type': 'boolean'},
967+ 'domain' : {'name':'domain', 'string': _t('Domain'), 'type': 'char'},
968+ 'context' : {'name':'context', 'string': _t('Context'), 'type': 'char'},
969+ 'limit' : {'name':'limit', 'string': _t('Limit'), 'type': 'float'},
970+ 'min_rows' : {'name':'min_rows', 'string':_t( 'Minimum rows'), 'type': 'float'},
971+ 'date_start' : {'name':'date_start', 'string': _t('Start date'), 'type': 'char'},
972+ 'date_delay' : {'name':'date_delay', 'string': _t('Delay date'), 'type': 'char'},
973+ 'day_length' : {'name':'day_length', 'string': _t('Day length'), 'type': 'char'},
974+ 'mode' : {'name':'mode', 'string': _t('Mode'), 'type': 'char'},
975+ 'align' : {'name':'align', 'string': _t('Alignment'), 'type': 'selection', 'selection': [['', ''], ['0.0', _t('Left')], ['0.5', _t('Center')], ['1.0', _t('Right')]]},
976+ 'icon' : {'name':'icon', 'string': _t('Icon'), 'type': 'selection', 'selection': _ICONS},
977+ 'type' : {'name':'type', 'string': _t('Type'), 'type': 'selection', 'selection': [['', ''], ['action', _t('Action')], ['object', _t('Object')], ['workflow', _t('Workflow')], ['server_action', _t('Server Action')]]},
978+ 'special' : {'name':'special', 'string': _t('Special'), 'type': 'selection', 'selection': [['',''],['save', _t('Save Button')], ['cancel', _t('Cancel Button')], ['open', _t('Open Button')]]},
979+ 'target' : {'name':'target', 'string': _t('Target'), 'type': 'selection', 'selection': [['', ''], ['new', _t('New Window')]]},
980+ 'confirm' : {'name':'confirm', 'string': _t('Confirm'), 'type': 'char'},
981+ 'style' : {'name':'style', 'string': _t('Style'), 'type': 'selection', 'selection':[["",""],["1", "1"],["1-1", "1-1"],["1-2", "1-2"],["2-1", "2-1"],["1-1-1", "1-1-1"]]},
982+ 'filename' : {'name':'filename', 'string': _t('File Name'), 'type': 'char'},
983+ 'width' : {'name':'width', 'string': _t('Width'), 'type': 'float'},
984+ 'height' : {'name':'height', 'string': _t('Height'), 'type': 'float'},
985+ 'attrs' : {'name':'attrs', 'string': _t('Attrs'), 'type': 'char'},
986+ 'col' : {'name':'col', 'string': _t('Col'), 'type': 'float'},
987+ 'link' : {'name':'link', 'string': _t('Link'), 'type': 'char'},
988+ 'position' : {'name':'position', 'string': _t('Position'), 'type': 'selection', 'selection': [['',''],['after', _t('After')],['before', _t('Before')],['inside', _t('Inside')],['replace', _t('Replace')]]},
989+ 'states' : {'name':'states', 'string': _t('States'), 'type': 'char'},
990+ 'eval' : {'name':'eval', 'string': _t('Eval'), 'type': 'char'},
991+ 'ref' : {'name':'ref', 'string': _t('Ref'), 'type': 'char'},
992+ 'on_change' : {'name':'on_change', 'string': _t('On change'), 'type': 'char'},
993+ 'nolabel' : {'name':'nolabel', 'string': _t('No label'), 'type': 'boolean'},
994+ 'completion' : {'name':'completion', 'string': _t('Completion'), 'type': 'boolean'},
995+ 'colspan' : {'name':'colspan', 'string': _t('Colspan'), 'type': 'float'},
996+ 'widget' : {'name':'widget', 'string': _t('Widget'), 'type': 'selection'},
997+ 'colors' : {'name':'colors', 'string': _t('Colors'), 'type': 'char'},
998+ 'editable' : {'name':'editable', 'string': _t('Editable'), 'type': 'selection', 'selection': [["",""],["top",_t("Top")],["bottom", _t("Bottom")]]},
999+ 'groups' : {'name':'groups', 'string': _t('Groups'), 'type': 'selection_multi'},
1000+ 'fonts' : {'name':'fonts', 'string': _t('Fonts'), 'type': 'char'},
1001 };
1002 var arch_val = self.get_object_by_id(this.one_object.clicked_tr_id,this.one_object['main_object'], []);
1003 this.edit_node_dialog.$el.append('<table id="rec_table" style="width:400px" class="oe_form"></table>');
1004@@ -947,9 +947,9 @@
1005 },
1006 on_add_node: function(properties, fields, position){
1007 var self = this;
1008- var render_list = [{'name': 'node_type','selection': _.keys(_CHILDREN).sort(), 'value': 'field', 'string': 'Node Type','type': 'selection'},
1009+ var render_list = [{'name': 'node_type','selection': _.keys(_CHILDREN).sort(), 'value': 'field', 'string': _t('Node Type'),'type': 'selection'},
1010 {'name': 'field_value','selection': fields, 'value': false, 'string': '','type': 'selection'},
1011- {'name': 'position','selection': position, 'value': false, 'string': 'Position','type': 'selection'}];
1012+ {'name': 'position','selection': position, 'value': false, 'string': _t('Position'),'type': 'selection'}];
1013 this.add_widget = [];
1014 this.add_node_dialog = new instance.web.Dialog(this,{
1015 title: _t("Properties"),
1016@@ -960,7 +960,7 @@
1017 _.each(self.add_widget, function(widget) {
1018 values[widget.name] = widget.get_value() || false;
1019 });
1020- (values.position == "Inside")?
1021+ (values.position == _t("Inside"))?
1022 check_add_node =(_.include(_CHILDREN[properties[0]],values.node_type))?true:false:
1023 check_add_node =(_.include(_CHILDREN[properties[1]],values.node_type))?true:false;
1024 if(values.node_type == "field" && check_add_node )

Subscribers

People subscribed via source and target branches

to all changes: