What is the meaning of 's' in {l s='Accept PayPal' mod='paypal'} - prestashop

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.

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.

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

Related

What is the VS Code TextMate syntax for JSON inside an HTML attribute

I would like to add a grammar rule similar to the one found here. What that rule does is enable VSCode's JSON editor when it encounters an html file with
<script type="application/json">#Edit JSON</script>
What I would like is the same JSON editor support whenever it encounters a html attribute in this form:
<my-chart data='{"hello": "world"}'></my-chart>
In other words, any attribute that uses single quotes, inside of which it starts with a { and ends with a }, or starts with a [ and ends with a ].
Any suggestions what that should look like?
I've basically found a way. WIP

Can't set defaultValue using react.rb

My code is
input(type: "text", name: "name", defalut_value: obj.name)
and I try this too
input(type: "text", name: "name", defalutValue: obj.name)
I always got
<input type="text" name="name" data-reactid=".0.1.1.1.1">
with no "defalutValue"
Short answer: try defaultValue (not defalutValue) (you had a typo in the string)
Long answer:
React only passes along standard attributes or data attributes (like "data-foo") to built in tags everything else is scrubbed off. Standard attributes that have dashes, should be camel cased (i.e. defaultValue.)
The camel casing is a bit inconsistent and is planned to be fixed in 0.9 BTW
For now the rules are:
1) for built in tags, only standard attributes or attributes beginning with "data-..." are passed along.
2) if the html attribute has a dash (like default-value) the react attribute will be camel cased (like defaultValue) except for data- tags.
3) For application defined components you need to use a legal ruby variable name, and class and style attributes are handled specially.
Here is a working example http://goo.gl/abv28C

prestashop mail customisation, and module translation

i have two question
1 - i installed referral program module , and i would like to customise the referralprogram-invitation.html mail template
so i putted the new template under : prestashop_root/themes/my_theme/modules/referralprogram/mails/referralprogram-invitation.html
but i doesn't work !
2 - i would like to add some extra text to the program page of referral program module
so i copied the file already included with the module under
prestashop_root/themes/my_theme/modules/referralprogram/translations/fr.php and I added the new text translation in this form
$_MODULE['<{referralprogram}prestashop>program_MD5'] = 'new text';
and it does not work?!!
You only forgot the language folder. Your mail templates must not be in :
prestashop_root/themes/my_theme/modules/referralprogram/mails/referralprogram-invitation.html
but in
prestashop_root/themes/my_theme/modules/referralprogram/mails/fr/referralprogram-invitation.html
If you want to add text to the program page, you must:
First, make a copy of the file : prestashop_root/modules/referralprogram/views/templates/front/program.tpl to prestashop_root/themes/my_theme/modules/referralprogram/views/templates/front/program.tpl
Then, you need to modify this file and add the text you want, where you want. To be translatable, your text must be added like this {l s='new text' mod='referralprogram'}.
Finally, you need to translate this text via the Localization > Traductions page of your BO and not directly in the fr.php file.
Do not hesitate if you need more information,
Paul.

Opencart display one module conents into another module

I'm having custom footer module in my template. Also i'm using testimonial module in the position content bottom. I'm trying to display testimonial inside custom footer.
To do this i simply copied testimonial.tpl and testimonial.php contents and pasted into customfooter.tpl and customfooter.php
After this i'm getting errors stating
undefined variable and class name already assigned error
Did you know how to do this?
See this answer for how to do use a module in a separate modification/controller
opencart - How to manually display a module inside a template file?
You simply need to change from the common/home to your module's controller and view files
please define variable.
how can you define i will show you.
catalog > controller > header.php
for static variable
$this->load->language('common/header');
$data['text_home'] = $this->language->get('text_home');
// Where language file in assign this variable with different language foler
$data['text_home'] = $this->url->link('information/contact');
and you can tpl file in use this varible.
<?php echo $text_home; ?>
make sure 100% erorr has not facing
for dynamic variable

Programming Syntax For PhpBB Forum

I would like to know more about the syntax for phpBB, for example the code below :
<div id="site-description">
{SITE_LOGO_IMG}
<h1>{SITENAME}</h1>
<p>{SITE_DESCRIPTION}</p>
<p class="skiplink">{L_SKIP}</p>
</div>
I have 2 questions -
1.) How do the program define the data inside {xxx}?
2.) Where is the files located or what is the file name to define the data inside {xxx}
Thanks for helping.
{L_*} is language syntax and it located in the languages folder.When the tag starts with L_ it recognise it as a language variable, else its recognised as a variable specified from the source.
The template tags {} are defined in includes/template.php
If you have a page named page.php and with defined phpbb in it, you can create own tag and use it on own template.There are global tags in includes/functions.php and private for each file (like in viewtopic.php there is postrow. template prefix).
See http://wiki.phpbb.com/Template.assign_vars for making and using such template tags.