Jiten (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-944280-jra into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #944280 in OpenERP Web: "Mobile gui not translated strings"
  https://bugs.launchpad.net/openerp-web/+bug/944280

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-944280-jra/+merge/96331

- Improved translation to add translation(_t) for Mobile Web Client,
- Remove text from header button which is generated own by mobile lib only.

-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-944280-jra/+merge/96331
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-944280-jra.
=== modified file 'addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0a4.1.js'
--- addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0a4.1.js	2011-08-12 07:31:16 +0000
+++ addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0a4.1.js	2012-03-07 11:26:17 +0000
@@ -1591,7 +1591,7 @@
 
 $.widget( "mobile.page", $.mobile.widget, {
 	options: {
-		backBtnText: "Back",
+		backBtnText: "",
 		addBackBtn: true,
 		backBtnTheme: null,
 		degradeInputs: {
@@ -3934,8 +3934,10 @@
 		}
 
 		if ( o.iconpos ) {
+            if ( o.iconpos == "left") {
+                o.iconpos = "notext"
+            }
 			buttonClass += " ui-btn-icon-" + o.iconpos;
-
 			if ( o.iconpos == "notext" && !el.attr("title") ) {
 				el.attr( "title", el.text() );
 			}

=== modified file 'addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0a4.1.min.js'
--- addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0a4.1.min.js	2011-06-13 05:19:16 +0000
+++ addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0a4.1.min.js	2012-03-07 11:26:17 +0000
@@ -34,7 +34,7 @@
 (function(a,c,d){function e(m){m=m||location.href;return"#"+m.replace(/^[^#]*#?(.*)$/,"$1")}var b="hashchange",f=document,h,i=a.event.special,g=f.documentMode,j="on"+b in c&&(g===d||g>7);a.fn[b]=function(m){return m?this.bind(b,m):this.trigger(b)};a.fn[b].delay=50;i[b]=a.extend(i[b],{setup:function(){if(j)return false;a(h.start)},teardown:function(){if(j)return false;a(h.stop)}});h=function(){function m(){var w=e(),x=y(q);if(w!==q){r(q=w,x);a(c).trigger(b)}else if(x!==q)location.href=location.href.replace(/#.*/,
 "")+x;k=setTimeout(m,a.fn[b].delay)}var p={},k,q=e(),u=function(w){return w},r=u,y=u;p.start=function(){k||m()};p.stop=function(){k&&clearTimeout(k);k=d};a.browser.msie&&!j&&function(){var w,x;p.start=function(){if(!w){x=(x=a.fn[b].src)&&x+e();w=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){x||r(e());m()}).attr("src",x||"javascript:0").insertAfter("body")[0].contentWindow;f.onpropertychange=function(){try{if(event.propertyName==="title")w.document.title=f.title}catch(A){}}}};
 p.stop=u;y=function(){return e(w.location.href)};r=function(A,l){var o=w.document,t=a.fn[b].domain;if(A!==l){o.title=f.title;o.open();t&&o.write('<script>document.domain="'+t+'"<\/script>');o.close();w.location.hash=A}}}();return p}()})(jQuery,this);
-(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"Back",addBackBtn:true,backBtnTheme:null,degradeInputs:{color:false,date:false,datetime:false,"datetime-local":false,email:false,month:false,number:false,range:"number",search:true,tel:false,time:false,url:false,week:false},keepNative:null},_create:function(){var c=this.element,d=this.options;this.keepNative=":jqmData(role='none'), :jqmData(role='nojs')"+(d.keepNative?", "+d.keepNative:"");if(this._trigger("beforeCreate")!==
+(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"",addBackBtn:true,backBtnTheme:null,degradeInputs:{color:false,date:false,datetime:false,"datetime-local":false,email:false,month:false,number:false,range:"number",search:true,tel:false,time:false,url:false,week:false},keepNative:null},_create:function(){var c=this.element,d=this.options;this.keepNative=":jqmData(role='none'), :jqmData(role='nojs')"+(d.keepNative?", "+d.keepNative:"");if(this._trigger("beforeCreate")!==
 false){c.find(":jqmData(role='page'), :jqmData(role='content')").andSelf().each(function(){a(this).addClass("ui-"+a(this).jqmData("role"))});c.find(":jqmData(role='nojs')").addClass("ui-nojs");c.find(":jqmData(role)").andSelf().each(function(){var e=a(this),b=e.jqmData("role"),f=e.jqmData("theme");if(b==="header"||b==="footer"){e.addClass("ui-bar-"+(f||e.parent(":jqmData(role='page')").jqmData("theme")||"a"));e.attr("role",b==="header"?"banner":"contentinfo");f=e.children("a");var h=f.hasClass("ui-btn-left"),
 i=f.hasClass("ui-btn-right");if(!h)h=f.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length;i||f.eq(1).addClass("ui-btn-right");if(d.addBackBtn&&b==="header"&&a(".ui-page").length>1&&c.jqmData("url")!==a.mobile.path.stripHash(location.hash)&&!h&&e.jqmData("backbtn")!==false){f=a("<a href='#' class='ui-btn-left' data-"+a.mobile.ns+"rel='back' data-"+a.mobile.ns+"icon='arrow-l'>"+d.backBtnText+"</a>").prependTo(e);d.backBtnTheme&&f.attr("data-"+a.mobile.ns+"theme",d.backBtnTheme)}e.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({tabindex:"0",
 role:"heading","aria-level":"1"})}else if(b==="content"){f&&e.addClass("ui-body-"+f);e.attr("role","main")}else if(b==="page")e.addClass("ui-body-"+(f||"c"));switch(b){case "header":case "footer":case "page":case "content":e.addClass("ui-"+b);break;case "collapsible":case "fieldcontain":case "navbar":case "listview":case "dialog":e[b]()}});this._enhanceControls();c.find(":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a").not(".ui-btn").not(this.keepNative).buttonMarkup();c.find(":jqmData(role='controlgroup')").controlgroup();

=== modified file 'addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0b1.min.js'
--- addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0b1.min.js	2011-08-12 07:31:16 +0000
+++ addons/web_mobile/static/lib/jquery_mobile/js/jquery.mobile-1.0b1.min.js	2012-03-07 11:26:17 +0000
@@ -34,7 +34,7 @@
 (function(a,d,c){function b(a){a=a||location.href;return"#"+a.replace(/^[^#]*#?(.*)$/,"$1")}var e="hashchange",f=document,g,i=a.event.special,h=f.documentMode,l="on"+e in d&&(h===c||h>7);a.fn[e]=function(a){return a?this.bind(e,a):this.trigger(e)};a.fn[e].delay=50;i[e]=a.extend(i[e],{setup:function(){if(l)return!1;a(g.start)},teardown:function(){if(l)return!1;a(g.stop)}});g=function(){function g(){var c=b(),f=n(i);if(c!==i)q(i=c,f),a(d).trigger(e);else if(f!==i)location.href=location.href.replace(/#.*/,
 "")+f;j=setTimeout(g,a.fn[e].delay)}var h={},j,i=b(),k=function(a){return a},q=k,n=k;h.start=function(){j||g()};h.stop=function(){j&&clearTimeout(j);j=c};a.browser.msie&&!l&&function(){var c,d;h.start=function(){if(!c)d=(d=a.fn[e].src)&&d+b(),c=a('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){d||q(b());g()}).attr("src",d||"javascript:0").insertAfter("body")[0].contentWindow,f.onpropertychange=function(){try{if(event.propertyName==="title")c.document.title=f.title}catch(a){}}};
 h.stop=k;n=function(){return b(c.location.href)};q=function(b,d){var g=c.document,h=a.fn[e].domain;if(b!==d)g.title=f.title,g.open(),h&&g.write('<script>document.domain="'+h+'"<\/script>'),g.close(),c.location.hash=b}}();return h}()})(jQuery,this);
-(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"Back",addBackBtn:!1,backBtnTheme:null,degradeInputs:{color:!1,date:!1,datetime:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:"number",search:!0,tel:!1,time:!1,url:!1,week:!1},keepNative:null},_create:function(){var d=this.element,c=this.options;this.keepNative=":jqmData(role='none'), :jqmData(role='nojs')"+(c.keepNative?", "+c.keepNative:"");this._trigger("beforeCreate")!==!1&&(d.find(":jqmData(role='page'), :jqmData(role='content')").andSelf().each(function(){a(this).addClass("ui-"+
+(function(a){a.widget("mobile.page",a.mobile.widget,{options:{backBtnText:"",addBackBtn:!1,backBtnTheme:null,degradeInputs:{color:!1,date:!1,datetime:!1,"datetime-local":!1,email:!1,month:!1,number:!1,range:"number",search:!0,tel:!1,time:!1,url:!1,week:!1},keepNative:null},_create:function(){var d=this.element,c=this.options;this.keepNative=":jqmData(role='none'), :jqmData(role='nojs')"+(c.keepNative?", "+c.keepNative:"");this._trigger("beforeCreate")!==!1&&(d.find(":jqmData(role='page'), :jqmData(role='content')").andSelf().each(function(){a(this).addClass("ui-"+
 a(this).jqmData("role"))}),d.find(":jqmData(role='nojs')").addClass("ui-nojs"),d.find(":jqmData(role)").andSelf().each(function(){var b=a(this),e=b.jqmData("role"),f=b.jqmData("theme");if(e==="header"||e==="footer"){b.addClass("ui-bar-"+(f||b.parent(":jqmData(role='page')").jqmData("theme")||"a"));b.attr("role",e==="header"?"banner":"contentinfo");var f=b.children("a"),g=f.hasClass("ui-btn-left"),i=f.hasClass("ui-btn-right");if(!g)g=f.eq(0).not(".ui-btn-right").addClass("ui-btn-left").length;i||f.eq(1).addClass("ui-btn-right");
 c.addBackBtn&&e==="header"&&a(".ui-page").length>1&&d.jqmData("url")!==a.mobile.path.stripHash(location.hash)&&!g&&b.jqmData("backbtn")!==!1&&(f=a("<a href='#' class='ui-btn-left' data-"+a.mobile.ns+"rel='back' data-"+a.mobile.ns+"icon='arrow-l'>"+c.backBtnText+"</a>").prependTo(b),c.backBtnTheme&&f.attr("data-"+a.mobile.ns+"theme",c.backBtnTheme));b.children("h1, h2, h3, h4, h5, h6").addClass("ui-title").attr({tabindex:"0",role:"heading","aria-level":"1"})}else e==="content"?(f&&b.addClass("ui-body-"+
 f),b.attr("role","main")):e==="page"&&b.addClass("ui-body-"+(f||"c"));switch(e){case "header":case "footer":case "page":case "content":b.addClass("ui-"+e);break;case "collapsible":case "fieldcontain":case "navbar":case "listview":case "dialog":b[e]()}}),this._enhanceControls(),d.find(":jqmData(role='button'), .ui-bar > a, .ui-header > a, .ui-footer > a").not(".ui-btn").not(this.keepNative).buttonMarkup(),d.find(":jqmData(role='controlgroup')").controlgroup(),d.find("a:not(.ui-btn):not(.ui-link-inherit)").not(this.keepNative).addClass("ui-link"),

=== modified file 'addons/web_mobile/static/src/js/chrome_mobile.js'
--- addons/web_mobile/static/src/js/chrome_mobile.js	2012-03-01 11:26:27 +0000
+++ addons/web_mobile/static/src/js/chrome_mobile.js	2012-03-07 11:26:17 +0000
@@ -3,7 +3,8 @@
  *---------------------------------------------------------*/
 
 openerp.web_mobile.chrome_mobile = function(openerp) {
-
+    _t = openerp.web._t;
+    
 openerp.web_mobile.mobilewebclient = function(element_id) {
     // TODO Helper to start mobile webclient rename it openerp.web.webclient
     var client = new openerp.web_mobile.MobileWebClient(element_id);
@@ -154,7 +155,7 @@
         var self = this;
         this.rpc('/web/session/sc_list',{} ,function(res){
             self.$element.html(self.render({'sc': res}));
-            self.$element.find("[data-role=header]").find('h1').html('Favourite');
+            self.$element.find("[data-role=header]").find('h1').html(_t('Favourite'));
             self.$element.find("[data-role=header]").find('#home').click(function(){
                 $.mobile.changePage("#oe_menu", "slide", false, true);
             });
@@ -204,7 +205,7 @@
         this.footer = new openerp.web_mobile.Footer(this, "oe_footer");
         this.footer.start();
         this.$element.html(this.render(this.data));
-        this.$element.find("[data-role=header]").find('h1').html('Applications');
+        this.$element.find("[data-role=header]").find('h1').html(_t('Home'));
         this.$element.find("[data-role=header]").find('#home').hide();
         this.$element.find("[data-role=footer]").find('#shrotcuts').click(function(){
             if(!$('#oe_shortcuts').html().length){
@@ -312,7 +313,7 @@
     start: function() {
         var self = this;
         this.$element.html(this.render(this));
-        this.$element.find("[data-role=header]").find('h1').html('Preference');
+        this.$element.find("[data-role=header]").find('h1').html(_t('Preference'));
         this.$element.find("[data-role=header]").find('#home').click(function(){
             $.mobile.changePage("#oe_menu", "slide", false, true);
         });

=== modified file 'addons/web_mobile/static/src/js/form_mobile.js'
--- addons/web_mobile/static/src/js/form_mobile.js	2012-01-24 14:58:10 +0000
+++ addons/web_mobile/static/src/js/form_mobile.js	2012-03-07 11:26:17 +0000
@@ -3,7 +3,8 @@
  *---------------------------------------------------------*/
 
 openerp.web_mobile.form_mobile = function (openerp) {
-
+    _t = openerp.web._t;
+    
 openerp.web_mobile.FormView = openerp.web.OldWidget.extend({
 
     template: 'FormView',

=== modified file 'addons/web_mobile/static/src/js/list_mobile.js'
--- addons/web_mobile/static/src/js/list_mobile.js	2012-01-24 14:58:10 +0000
+++ addons/web_mobile/static/src/js/list_mobile.js	2012-03-07 11:26:17 +0000
@@ -3,7 +3,8 @@
  *---------------------------------------------------------*/
 
 openerp.web_mobile.list_mobile = function (openerp) {
-
+    _t = openerp.web._t;
+    
 openerp.web_mobile.ListView = openerp.web.OldWidget.extend({
 
     template: 'ListView',

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to