title: Thymeleaf How to add conditional block in javascript
body: <p>I have a web application and using Thymeleaf with spring boot, I need to include an option in my javascript in-case the user locale was Arabic, so how add a conditional block and should be processed at server side?</p>
  
  <pre><code>&lt;script th:inline="javascript"&gt;
          var customerNameTitle = /*[[#{pendingPayments.customerName}]]*/ 'customer Name';
          var amountTitle = /*[[#{pendingPayments.amount}]]*/ 'Amount';
          var paymentDateTitle = /*[[#{pendingPayments.paymentDate}]]*/ 'payment Date';
          var submissionDateTitle = /*[[#{pendingPayments.submissionDate}]]*/ 'submission Date';
  
          $("document").ready(function(e) {
              /*&lt;![CDATA[*/
                 var table = $("#example").DataTable( {
                      "ajax": {
                                  "url": /*[[@{/payments/getPendingPayments}]]*/ "",
                                  "type": "GET",
                                  "dataSrc": ""
                              },
                      "columns": [
                                  { "data": "customerFullName", "title": customerNameTitle },
                                  { "data": "amount", "title": amountTitle },
                                  { "data": "paymentDate", "title": paymentDateTitle },
                                  { "data": "submissionDate", "title": submissionDateTitle },
                              ],
                      "language": {
                                  "emptyTable": /*[[#{pendingPayments.emptyTable}]]*/ "",
                                  "url":/*[[@{'/json/dataTables-ar.json'}]]*/ ""
                                }
                  });
              /*]]&gt;*/
             });
      &lt;/script&gt;
  </code></pre>
  
  <p>the <code>"url":/*[[@{'/json/dataTables-ar.json'}]]*/</code> should only be loaded if the locale is Arabic, otherwise the the whole line shouldn't be printed in HTML page..</p>
  
  <p>in JSTL I can do that using <code>&lt;c:if&gt;</code></p>
  
  <pre><code>&lt;c:if test="${LOCALE.language eq 'ar' }"&gt;
      ....
  &lt;/c:if&gt;
  </code></pre>
  
  <p>is there an equivalent in Thymeleaf? </p>