😎
ClipBucket
  • What is ClipBucket
  • Fundamentals
    • Files Structure
    • Basic Understandings
      • Videos Class & Functions
      • User Class & Functions
      • Template Class & Functions
      • DB.class & Functions
      • User Levels & Permissions
  • Guides
    • Template Customization
    • Plugin Development
    • Anchors, Functions & Filters
    • Clipbucket template files
    • Functions
      • add_admin_menu
      • get_thumb
      • FlashPlayer
      • {ANCHOR }
      • add_js
      • lang
      • {videoLink }
      • get_users
      • get_videos
  • Group 1
    • Users
Powered by GitBook
On this page
  1. Guides
  2. Functions

lang

Previousadd_jsNext{videoLink }

Last updated 3 years ago

{lang }function is basically used to display phrases such as User doesnt exist. It helps make Clip Bucket Multilingual.

Usage

{lang code='var_code'}

Examples

Example 1

{lang code='usr_exist_err'}

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.

{lang code="user_commented_time"}

This will print ‘%s commented %s’. This makes no sense. So we will assign this value to a variable.

{lang code="user_commented_time" assign="comment_string"}

Now it is stored in variable called {$comment_string}. We will now use ‘sprintf’ modifier to assign values one by one.

{$comment_string|sprintf:'http://test.com':'Username','3 weeks ago'}

This will print: Username commented 3 weeks ago.

Complete list of phrases with respective codes can be found here

Loading...