Changing text in Webtix (the language function)

(Last updated on: February 8, 2016)

With Webtix, we have made our best guess as to what your customers will understand. For instance, the word “performance” refers to a single date and time of an event. However, customers may expect the word “game” to refer to the data and time. Also, your customers may not even speak English. They may need Webtix in a different language. Here is how Webtix handles this.

Webtix uses a “translation table.” This is a file where Webtix looks up a text string and finds text to substitute. There are a couple components:
The translation table
The setting in config.php
The lang() function – which does the work

The steps:
Copy the empty language table from the /_includes subdirectory to /_custom/_includes. There are 4 language files:
lib_lang_en-CA.php
lib_lang_en-MX.php
lib_lang_en-US.php
lib_lang_en_fr-CA.php

Inside each file, you will find a sample of text relating to each language
$lang[“Select an event”] = “Choisissez un evenement”;
$lang[“by”] = “par”;
$lang[“Theatre”] = “Theatre”;
$lang[“Location”] = “Endroit”;
$lang[“Type”] = “Type”;
$lang[“Week”] = “Semaine”;

Go into /_custom/_includes/config.php and look for the setting $cstage[‘default-language’] This will be about line 34. You will want to change it to the abbreviation of the language you want. For instance, if you want to use a Spanish translation, you would use a setting like this:
$cstage[‘default-language’] = ‘en-MX’;
That tells Webtix to look in the translation table called lib_lang_en-MX.php

In the PHP code that makes up Webtix, you will see the lang() function called. It looks like this:
<?php echo lang(“Select an event”); ?>
That tells Webtix to look for the statement “Select an event” in the translation table. If it finds that string, put in the string from the translation table. If you are using the French table, you will have the statement “Choisissez un evenement” appear on every occurance of “Select an event” If there is no entry in the translation table (or the translation table does not exist) Webtix will display the default text.

Notes:
If you need more words or phrases, add them to the translation table
This function is case sensitive
There must be an exact match – punctuation is important.

This entry was posted in Webtix Online Ticketing and tagged . Bookmark the permalink.

Leave a Reply