...
It will show: Spanish Phrase text (If default language of users is es)
....
2. How to use
Default
Code Block | ||||
---|---|---|---|---|
| ||||
<?php
_p('var_name', $attr) |
Smarty
Code Block | ||||
---|---|---|---|---|
| ||||
{_p var="var_name" $attr} |
Twig
Code Block | ||||
---|---|---|---|---|
| ||||
{_p var="var_name" $attr} |
Twig
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{{ _p("var_name", $arrt) }} |
Javascript
Code Block | ||||
---|---|---|---|---|
| ||||
oTranslations['var_name', arrt] |
With $arrt is array of variable on phrase.
3. Use Phrase with variable
The variable can be included in a phrase. Example:
Code Block | ||||
---|---|---|---|---|
| ||||
{
"total_people_liked_this_blog" : "{total} people liked this blog
} |
Use:
Code Block | ||||
---|---|---|---|---|
| ||||
<?php
echo _p("total_people_liked_this_blog", ["total" => 5]); |
It will show: 5 people liked this blog
Note: Use single sign { and } for variable.