2.2 Translators Table

Introduction

The Translators table is the table in which custom tags are defined. It may be left empty.

Definition

The translators table is one of 2 tables that must exist, and it must have the following structure:

CREATE TABLE `translators` (
`id` int(11) NOT NULL auto_increment,
`code` char(20) NOT NULL,
`ttype` char(1) NOT NULL,
`text` varchar(500) NOT NULL,
`sourcetable` varchar(100) default NULL,
`targettable` varchar(100) default NULL,
PRIMARY KEY (`id`) ) ENGINE=MyISAM;

Description

Translators dynamically define symbols that will be translated into text. Translators are defined in a table names translators. The table has following fields:

  • code: code to be translated
  • ttype: type of translator - see below
  • text: translated text
  • sourcetable: source table
  • targettable: target table - probably already obsolete... not used.

Different types of translators behave differently. Here is how:

  • TTtype = A: these are aggregators; they refer to the summary pages for a whole table. Example
    • code = hGM
    • sourcetable = games
    • targettable stays empty
    • text = Games
    • @$hGM$@ will be translated into hyperlink like Games, that will link to the summary page for the games table.
  • TTtype = T: these are translators that refer to pages for records in a table. Example
    • code = gm
    • sourcetable = games
    • targettable stays empty
    • text stays emtpy
    • @$gm Game_Name$@ will be translated into hyperlink like Games Name, that will link to the page for the recors in games table with title = "Game Name". Note the use of the underscore for spaces!
  • TTtype = V: these are Verbatim translators. Consider those as like simple shortcuts. Example
    • code = Contents
    • sourcetable = empty
    • targettable stays empty
    • text = < p class=\"HeaderStyle\" > Contents </p>;
    • CONTENTS will be translated into the text, without any substitutions.