Skip to content

Instantly share code, notes, and snippets.

@w-jerome
Last active January 20, 2020 09:39
Show Gist options
  • Save w-jerome/8b3b3de3eaed43e2abc8aa03ec4dcb9e to your computer and use it in GitHub Desktop.
Save w-jerome/8b3b3de3eaed43e2abc8aa03ec4dcb9e to your computer and use it in GitHub Desktop.
Prestashop, Smarty - Translate string
{*
* Prestashop 1.6 Documentation
* http://doc.prestashop.com/display/PS16/Module+translation
* https://stackoverflow.com/questions/11340742/pass-a-variable-inside-translation-string-in-prestashop
*}
{* Translate Back-Office Key *}
{l s='This is translation' mod='my_module'}
{* Variables *}
{l s='The number is %1$d' sprintf=$number}
{l s='The number is %1$d' sprintf=[$number]}
{l s='The number is %number%' sprintf=['%number%' => '1337']} {* not tested *}
{* Tags *}
{l s='[1]Lorem ipsum[/1] [2]Proin dictum lobortis blandit. Aenean vitae malesuada est.[/2]' tags=['<h2>', '<p>']}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment