<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/shinydashboards-from-right-to-left-localizing-a-shinydashboard-to-hebrew/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://r-posts.com/shinydashboards-from-right-to-left-localizing-a-shinydashboard-to-hebrew/"> R-posts.com</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><span><em>Post by Adi Sarid (<a rel="nofollow" href="http://www.sarid-ins.co.il/" target="_blank">Sarid Institute for Research Services LTD</a>.)</em></span></p>
<p>Lately I’ve been working a lot with the shinydashboard library.</p>
<p>Like shiny, it allows any R programmer to harness the power of R and create professional looking interactive apps. The thing about shinydashboards is that it makes wonderfully looking dashboards.</p>
<p>What I’ve been doing with the dashboards is to create dedicated dashboards for my customers. Since most of my customers speak, read, and write in Hebrew I needed to fit that into my shinydashboard apps (i.e., fully localize the app). See an example for such a localized dashboard I made <a rel="nofollow" href="https://sarid.shinyapps.io/Sarid-Sample-Report/" target="_blank">here</a>.</p>
<p>Making a shinydashboard localized turned out to be simpler than I thought. </p>
<p>Since the average R programmer doesn’t necessarily know and understand CSS, I thought I post my solution. This should fit any Hebrew or Arabic dashboard to work from right to left, including the sidebar and all other objects (though I only tested it in Hebrew).</p>
<p>If you want the short version: </p>
<p>(1) Download the following <a rel="nofollow" href="https://raw.githubusercontent.com/adisarid/adisarid.github.io/master/stylesheets/bootstrap-rtl.css" target="_blank">css file;</a></p>
<p>(2) Put it in a subfolder “/www” of your shinydashboard app;</p>
<p>(3) In your dashboardBody command (within the ui.R section of your shiny app) add the following code:</p>
<p><code>dashboardBody(<br>
   tags$head(<br>
      tags$link(rel = &quot;stylesheet&quot;, type = &quot;text/css&quot;, href = &quot;bootstrap-rtl.css&quot;<br>
),...</code></p>
<p></p>
<p>Here are the few insights and steps which lead me to this solution:</p>
<p><span>
<p>Insight #1: any shiny app (dashboard or otherwise) can be customized using CSS. That’s <a rel="nofollow" href="https://rstudio.github.io/shinydashboard/appearance.html#css" target="_blank">no secret</a>. However, the adaptation to RTL isn’t that simple when you have so many objects, mobile responsiveness to worry about, etc.</p></span>
<p><span>
<p>Insight #2: Shiny is based on the AdminLTE theme which is based on the bootstrap 3 theme. AdminLTE is a great theme, and even though it doesn’t officially support RTL, <em>mmdsharifi, </em>provided a <a rel="nofollow" href="https://github.com/mmdsharifi/AdminLTE-RTL" target="_blank">solution in his github page</a>. The same for bootstrap 3 which has an RTL customization by <em>morteza</em> (<a rel="nofollow" href="https://github.com/morteza/bootstrap-rtl" target="_blank">also on github</a>).</p></span>
<p><span>
<p>Insight #3: What I did in order to make this work was to take the bootstrap-rtl.css from <em>morteza, </em>and then concatenate the AdminLTE-rtl.css file by <em>mmdsharifi</em>. Voilà! (simple, isn’t it?) </p></span>
<p>Here’s the resulting <a rel="nofollow" href="https://raw.githubusercontent.com/adisarid/adisarid.github.io/master/stylesheets/bootstrap-rtl.css" target="_blank">css file</a>.</p>
<p>Thanks to 0xOri for suggesting and testing insight #3.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://r-posts.com/shinydashboards-from-right-to-left-localizing-a-shinydashboard-to-hebrew/"> R-posts.com</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/UPO0284IV-g" height="1"></a></div>