javascript - Using translation with jquery in prestashop -
i'm trying translate terms when i'm using jquery inside smarty file. jquery code:
else { $("#message").val("{l s='please try clear.'}");
this phrase appears {l s='please try clear.'}
in web page , doesn't take consideration translation mode.
i know can use js=1 when i'm inside javascript code doesn't work me neither. have idea how use translation in jquery function?
it's practice use {literal}
tags around js blocks:
{literal} <script> /... </script> {/literal}
but when need insert smarty js block, won't work; make work have close , reopen tags (looks little bit of hack :)
{literal} <script> var txt = '{/literal}{l s='some text'}{literal}' </script> {/literal}
also in prestashop templates you'll find;
{strip} {addjsdefl name=translation_6}{l s='not found' js=1}{/addjsdefl} {/strip}
which create
var translation_6 = 'not found';
in body, able use
Comments
Post a Comment