-3

I'm new to Prestashop. While learning I found this

{l s='Accept PayPal' mod='paypal'}

I'm curious what does s means in the above statement. I know l is for the language but I don't know the meaning of s.

Bruno Leveque
  • 2,647
  • 2
  • 23
  • 33
Jack
  • 3
  • 6

2 Answers2

2

s means string and is the string to be translated.

l() is a custom Smarty function that we added in PrestaShop to make templates (.tpl files) translatable.

We registered it in /config/smarty.config.inc.php on line 86:

smartyRegisterFunction($smarty, 'function', 'l', 'smartyTranslate', false);

And then added it to \config\smartyfront.config.inc.php and config\smartyadmin.config.inc.php:

function smartyTranslate($params, $smarty)

You can use the following parameters:


mod To be used only within module templates (.tpl) files, with the name of the related module

Example: {l s='My module text' mod='mymodulename'}


js To be used within JavaScript code blocks, the translated content will be escaped

Example: var my_var = '{l s='Delete' d='Admin.Actions' js=1}';


pdf To be used in reference to a pdf file

Example: {l s='Note' d='Shop.Pdf' pdf='true'}


d To be used in reference to a specific translation file

Example: {l s='No menu' d='Admin.Advparameters.Feature'}


sprintf To be used if you have variables within the translated string

Example: {l s='My variable is %s' sprintf=[$my_var|escape:'html':'UTF-8']}


You can find more information in the PrestaShop 1.7 documentation here.

Bruno Leveque
  • 2,647
  • 2
  • 23
  • 33
0

the "s" just mean "string", and "l" is "language", so why to not use "m" instead of "mod" ;)

devseo
  • 1,182
  • 1
  • 13
  • 26