Bug 1594833 - Send over writing system direction to pocket popup r=Gijs
authorScott <scott.downe@gmail.com>
Fri, 08 Nov 2019 19:40:57 +0000
changeset 501353 aba92aad986e96b08f23ffd7a20a0d672efd2945
parent 501352 8823aa7d4ff9ea4ea54da4b453fdd17ddefb3b5c
child 501354 aa04697d9a3f061726fd6acec930bfaa4062d290
push id114168
push userdluca@mozilla.com
push dateSun, 10 Nov 2019 03:08:55 +0000
treeherdermozilla-inbound@33f64c1ef3e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1594833
milestone72.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1594833 - Send over writing system direction to pocket popup r=Gijs Differential Revision: https://phabricator.services.mozilla.com/D52227
browser/components/pocket/content/main.js
browser/components/pocket/content/panels/js/saved.js
browser/components/pocket/content/panels/js/signup.js
--- a/browser/components/pocket/content/main.js
+++ b/browser/components/pocket/content/main.js
@@ -631,16 +631,17 @@ var pktUI = (function() {
             data[str.key]
           );
         } else {
           strings[str.key] = str.value;
         }
       }
       pktUIMessaging.sendResponseMessageToPanel(panelId, _initL10NMessageId, {
         strings,
+        dir: Services.locale.isAppLocaleRTL ? "rtl" : "ltr",
       });
     });
   }
 
   // -- Browser Navigation -- //
 
   /**
    * Open a new tab with a given url and notify the iframe panel that it was opened
--- a/browser/components/pocket/content/panels/js/saved.js
+++ b/browser/components/pocket/content/panels/js/saved.js
@@ -701,12 +701,14 @@ PKT_SAVED.prototype = {
         "https://" + pocketHost + "/tos?s=ffi&t=tos&tv=panel_tryit",
         "https://" +
           pocketHost +
           "/privacy?s=ffi&t=privacypolicy&tv=panel_tryit",
       ],
     },
     function(resp) {
       window.pocketStrings = resp.strings;
+      // Set the writing system direction
+      document.documentElement.setAttribute("dir", resp.dir);
       window.thePKT_SAVED.create();
     }
   );
 });
--- a/browser/components/pocket/content/panels/js/signup.js
+++ b/browser/components/pocket/content/panels/js/signup.js
@@ -176,12 +176,14 @@ PKT_SIGNUP.prototype = {
         "https://" + pocketHost + "/tos?s=ffi&t=tos&tv=panel_tryit",
         "https://" +
           pocketHost +
           "/privacy?s=ffi&t=privacypolicy&tv=panel_tryit",
       ],
     },
     function(resp) {
       window.pocketStrings = resp.strings;
+      // Set the writing system direction
+      document.documentElement.setAttribute("dir", resp.dir);
       window.thePKT_SIGNUP.create();
     }
   );
 });