8.3 Multilingual Phrases
Built into your Tribiq CMS software is a powerful multilingual system. This allows you to serve multiple pages in different langauges, character sets and text direction (left-to-right, right-to-left).
When you are building your templates, you may realise that certain words you are using are not appropriate for users of all languages.
For example, you may create an Extranet login form with links to "Login" or "Register". Whilst your pages may have different language content, keeping the site interface in English all the time doesn't truly give that international (or local) website experience.
Fortunatly, where you find you may use an interface word or a phrase that will be different in each language, you can use a "Visitor Language Pack Phrase" or a "VLP". A VLP is a PHP function that will replace the specified code with the correct word or phrase in the current users langauge.
8.3.1 Adding VLPs
- First, you will want to create the VLP in the CMS system. You must make sure that the languages you want to cater for are first initalized on the "Languages Enabled" screen.

- Select the Visitor Langauge Pack tab. Choose to manage the site default langauge to create the code. We will choose English.
- Select the
icon to add a new phrase.
- Choose a _CODE and choose "A phrase".
- Add the phrase to the system.

- Repeat steps 2-5 for each language. You must use the same _CODE in each language.
8.3.2 Using VLPs
- In your template you will have the word or phrase written in static form. You will need to replace this with a PHP snippet that prints the correct phrase from the system. The correct syntax for this is:
<?php echo getVLPPhrase("_CODE") ?>
- Where _CODE is the _CODE you setup in the Visitor Language Packs.
- Your template should now show the phrase you entered in the system. Changing langauge will now change the phrase.
8.3.3 Advanced VLPs
It is possible that you might want to use a variable or other dynamic text within a phrase. In order to do this you must write a phrase that contains the location of the extra text to be used and modify the getVLPPhrase function.
- To use additional information in a VLP, you must write your phrase with the following syntax:
"This is a phrase with [[additional_code]]."
The double square brackets represent the data to be replaced.
- The PHP snippet will now change from
<?php echo getVLPPhrase("_CODE") ?>
to
<?php echo getVLPPhrase("_CODE", array('additional_code' => $variable)); ?>
- As you can see, we now include an array, which uses the code within the square brackets (from the phrase) and the content of this additional code (a variable containing text, e.g. a username).
Top of Page