This is an automated email from the git hooks/post-receive script.
cohosh pushed a change to branch main in repository pluggable-transports/snowflake-webext.
from e0f968b Rename badge.json to message.json to comply with firefox i18n new 1d669a6 change alignment by setting dir attribute new 1fd388f const for rtl langs + function to set lang direction
The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: static/index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
This is an automated email from the git hooks/post-receive script.
cohosh pushed a commit to branch main in repository pluggable-transports/snowflake-webext.
commit 1d669a6852df74f1049d6de638c783ea033051ab Author: luciole luciole@systemli.org AuthorDate: Wed Nov 2 13:37:28 2022 +0100
change alignment by setting dir attribute --- static/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/static/index.js b/static/index.js index 6861459..02f04a8 100644 --- a/static/index.js +++ b/static/index.js @@ -65,9 +65,11 @@ fetch(`./_locales/${gotLang}/website.json`) .then((json) => { var language = document.getElementById('language-switcher'); var lang = `${gotLang}`; - if ((lang == "ar") || (lang == "fa")) { - document.body.setAttribute('style', 'text-align:right'); - } + if (lang == "ar" || lang == "fa" || lang == "he" || lang == "ur") { + document.documentElement.dir = "rtl"; + } else { + document.documentElement.dir = "ltr"; + } language.innerText = `${availableLangs.get(lang)} (${lang})`; var messages = new Messages(json); fill(document.body, (m) => {
This is an automated email from the git hooks/post-receive script.
cohosh pushed a commit to branch main in repository pluggable-transports/snowflake-webext.
commit 1fd388f2275652fffca86877466c1cd0eed5c096 Author: luciole luciole@systemli.org AuthorDate: Fri Nov 4 12:01:49 2022 +0100
const for rtl langs + function to set lang direction --- static/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/static/index.js b/static/index.js index 02f04a8..53cc192 100644 --- a/static/index.js +++ b/static/index.js @@ -1,4 +1,5 @@ /* global availableLangs */ +const RTL_LANGS = new Set(["ar", "fa", "he", "ur"]);
class Messages { constructor(json) { @@ -39,6 +40,14 @@ var getLang = function() { return defaultLang; };
+var set_lang_direction = function(l) { + if (RTL_LANGS.has(l)) { + document.documentElement.dir = "rtl"; + } else { + document.documentElement.dir = "ltr"; + } +}; + var fill = function(n, func) { switch(n.nodeType) { case 1: // Node.ELEMENT_NODE @@ -65,11 +74,7 @@ fetch(`./_locales/${gotLang}/website.json`) .then((json) => { var language = document.getElementById('language-switcher'); var lang = `${gotLang}`; - if (lang == "ar" || lang == "fa" || lang == "he" || lang == "ur") { - document.documentElement.dir = "rtl"; - } else { - document.documentElement.dir = "ltr"; - } + set_lang_direction(lang); language.innerText = `${availableLangs.get(lang)} (${lang})`; var messages = new Messages(json); fill(document.body, (m) => {
tor-commits@lists.torproject.org