Translation/translation.str_mgmt.php

Description

File translation.str_mgmt.php

Additional functions for Translation class

Functions allowing user to create the new language, translation for specific strings and full management of the languages database.

Includes
require_once ('DB.php') (line 19)

require PEAR::DB

Functions
addTranslation (line 213)

Translation adding Adds string to one or more language tables.

  • return: Return 1 if everything went OK, a PEAR::DB_Error object if not.
mixed addTranslation (string $PageID, string $StringID, array $String, string $pear_DSN, [array $CustomTables = 0])
  • string $PageID: page identifier. Might be "" if the string is to be available from any page, independendly from translation object creation parameters.
  • string $StringID: string identifier. Must be unique for the same PageID and strings that were created without PageID's. This rule must be respected to prevent ambiguities.
  • array $String: array of strings - the array keys should be languages id's, the values - the sttrings in these languages - e.g.: ("en"->"English text", "pl"->"Tekst polski", ...)
  • string $pear_DSN: PEAR DSN string for database connection
  • array $CustomTables: Custom table definitions
createNewLang (line 85)

New language creation

Creates new language in the system. Creates lang entry in the languages table and the table for language strings. If other langs have been created before and their tables were filled with strings, function addTranslation should be executed for each of the added strings just after calling this function and before using the Translation class for any purpose.

  • return: Return 1 if everything went OK, a PEAR::DB_Error object if not.
mixed createNewLang (string $LangID, string $LangName, string $METATags, string $pear_DSN, [array $CustomTables = 0])
  • string $LangID: Language identifier
  • string $LangName: Language name - store the language name of the lang, possibly in the language described. This name can be later retrieved by calling getLangName and getOtherLangs methods and used for hyperlinks changing the site language.
  • string $METATags: Tags that may describe the language codepage etc. These tags can be retrieved by calling getMetaTags method.
  • string $pear_DSN: PEAR DSN string for database connection
  • array $CustomTables: Custom table definitions
removeLang (line 154)

Language removal

Removes language from system. This function should be used carefully - it will permanently remove all the strings that has been added to the language table by dropping this table. If other langs are stored in the table, then only this lang column will be dropped.

  • return: Return 1 if everything went OK, a PEAR::DB_Error object if not.
mixed removeLang (string $LangID, string $pear_DSN, [array $CustomTables = 0], [boolean $force = false])
  • string $LangID: Language identifier
  • string $pear_DSN: PEAR DSN string for database connection
  • array $CustomTables: Custom table definitions
  • boolean $force: If true, the table is dropped without checks
removeTranslation (line 255)

Translation removal

Removes string from all of string tables

  • return: Return 1 if everything went OK, a PEAR::DB_Error object if not.
mixed removeTranslation (string $PageID, string $StringID, string $pear_DSN, [array $CustomTables = 0])
  • string $PageID: page identifier.
  • string $StringID: string identifier.
  • string $pear_DSN: PEAR DSN string for database connection
  • array $CustomTables: Custom table definitions
setDefaultTableDefinitions (line 24)

helper method

void setDefaultTableDefinitions (mixed $LangID, mixed $CustomTables)

Documentation generated on Tue, 20 Jan 2004 22:54:55 +0100 by phpDocumentor 1.2.3