lang
{lang }function is basically used to display phrases such as User doesnt exist. It helps make Clip Bucket Multilingual.
Usage
1
{lang code='var_code'}
Copied!
Examples
Example 1
1
{lang code='usr_exist_err'}
Copied!
Above code will print ‘User doesnot Exist’.
Example 2
There are some phrases which uses ‘sprint_f‘ modifier to assign values on-fly. With these phrases lang function is used a little differently.
1
{lang code="user_commented_time"}
Copied!
This will print ‘%s commented %s’. This makes no sense. So we will assign this value to a variable.
1
{lang code="user_commented_time" assign="comment_string"}
Copied!
Now it is stored in variable called {$comment_string}. We will now use ‘sprintf’ modifier to assign values one by one.
1
{$comment_string|sprintf:'http://test.com':'Username','3 weeks ago'}
Copied!
This will print: Username commented 3 weeks ago.
Complete list of phrases with respective codes can be found here
Loading...
Last modified 12d ago
Copy link