Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
Add translation to a script option line inside JS as a variable Prestasip

i want to translate day in prestashop tpl (1.7.6.9) but doesent work, i have this script in a tpl. when i try to translate in prestashop always in French. do you have a solution ?

<script>
var carrier_store_delivery_id = "{$carrier_store_delivery_id}";
var current_post_code = "{$post_code}";
var current_address1 = "{$address1}";

var current_city = "{$city}";
var current_country = "{$country}";
var optionDefaultLabel = "{l s="Please select a day" mod='moduledelivery'}";
var optionRangeDefaultLabel = "{l s="Please select a time slot" mod='moduledelivery'}";

var dayList = [
    "{l s='Lundi' mod='moduledelivery'}";
    "{l s='Mardi' mod='moduledelivery'}";
    "{l s='Mercredi' mod='moduledelivery'}";
    "{l s='Jeudi' mod='moduledelivery'}";
    "{l s='Vendredi' mod='moduledelivery'}";
    "{l s='Samedi' mod='moduledelivery'}";
    "{l s='Dimanche' mod='moduledelivery'}";
];

var cancel_label = "{l s='Annuler' mod='moduledelivery'}";
var choose_label = "{l s='Choisir' mod='moduledelivery'}";
var store_addresses = [];
{foreach from=$coordinates item=element}
    store_addresses.push({$element|@json_encode nofilter});
{/foreach}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

PrestaShop default modules are the best guide.

blockcart module => blockcart.tpl :

{strip}
{addJsDefL name=customizationIdMessage}{l s='Customization #' mod='blockcart' js=1}{/addJsDefL}
{addJsDefL name=removingLinkText}{l s='remove this product from my cart' mod='blockcart' js=1}{/addJsDefL}
{addJsDefL name=freeShippingTranslation}{l s='Free shipping!' mod='blockcart' js=1}{/addJsDefL}
{addJsDefL name=freeProductTranslation}{l s='Free!' mod='blockcart' js=1} {/addJsDefL}
{addJsDefL name=delete_txt}{l s='Delete' mod='blockcart' js=1}{/addJsDefL}
{addJsDefL name=toBeDetermined}{l s='To be determined' mod='blockcart' js=1}{/addJsDefL}
{/strip}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!