/includes/translate.phpLanguage translation functions.
The idea is very much stolen from the GNU translate C library.
We load a translation file and store it in the global array $translations. If a cache dir is enabled (in $settings[]), then we serialize $translations and store it as a file in the cache dir. The next call will unserialize the cached file rather than re-parse the file.
Although there is a PHP gettext () function, I prefer to use this home-grown translate function since it is simpler to work with.
define_languages (line 384)
Generate translated array of language names
The first is the name presented to users while the second is the filename (without the ".txt") that must exist in the translations subdirectory. Only called from admin.php and pref.php.
etooltip (line 372)
Translates and removes HTML from text, and prints it.
This is useful for tooltips, which barf on HTML.
Note: () returns the result rather than print the value.
etranslate (line 342)
Translates text and prints it.
This is just an abbreviation for:
languageToAbbrev (line 453)
Converts language names to their abbreviation.
load_translation_text (line 157)
Loads all the language translation into an array for quick lookup.
Note: There is no need to call this manually. It will be invoked by () the first time it is called.
read_trans_file (line 62)
Read in a language file and cache it if we can.
reset_language (line 135)
Unloads $translations so we can translate a different language.
tooltip (line 356)
Translates and removes HTML from text, and returns it.
This is useful for tooltips, which barf on HTML.
Note: () prints the result rather than return the value.
translate (line 316)
Translates a string from the default English usage to another language.
The first time that this is called, the translation file will be loaded (with ()).
translation_exists (line 296)
unhtmlentities (line 36)
Performs html_entity_decode style conversion for php < 4.3 Borrowed from http://us2.php.net/manual/en/function.html-entity-decode.php
Documentation generated on Thu, 10 Jun 2010 17:08:37 -0400 by phpDocumentor 1.4.3