[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
[Code source] [Imprimer] [Statistiques]
(pas de description)
Poids: | 799 lignes (26 kb) |
Inclus ou requis: | 0 fois |
Référencé: | 0 fois |
Nécessite: | 0 fichiers |
translation:: (18 méthodes):
translation()
charset()
init()
translate()
add_app()
add_setup()
get_installed_langs()
lang2language()
list_langs()
get_installed_charsets()
convert()
install_langs()
autoload_changed_langfiles()
get_langs()
drop_langs()
add_langs()
write()
read()
Classe: translation - X-Ref
translation($warnings = False) X-Ref |
Constructor, sets up a copy of the db-object, gets the system-charset and tries to load the mbstring extension |
charset($lang=False) X-Ref |
returns the charset to use (!$lang) or the charset of the lang-files or $lang param: string/boolean $lang=False return charset of the active user-lang, or $lang if specified return: string charset |
init() X-Ref |
Initialises global lang-array and loads the 'common' and app-spec. translations |
translate($key, $vars=false, $not_found='*' ) X-Ref |
translates a phrase and evtl. substitute some variables param: string $key phrase to translate, may contain placeholders %N (N=1,2,...) for vars param: array/boolean $vars=false vars to replace the placeholders, or false for none param: string $not_found='*' what to add to not found phrases, default '*' return: string with translation |
add_app($app,$lang=False) X-Ref |
adds translations for an application from the database to the lang-array param: string $app name of the application to add (or 'common' for the general translations) param: string/boolean $lang=false 2 or 5 char lang-code or false for the users language |
add_setup($lang) X-Ref |
Adds setup's translations, they are not in the DB! param: string $lang 2 or 5 char lang-code |
get_installed_langs($force_read=false) X-Ref |
returns a list of installed langs param: boolean $force_read=false force a re-read of the languages return: array with lang-code => descriptiv lang-name pairs |
lang2language($lang) X-Ref |
translates a 2 or 5 char lang-code into a (verbose) language param: string $lang return: string/false language or false if not found |
list_langs() X-Ref |
List all languages, first the installed ones, then the availible ones and last the rest return: array with lang_id => lang_name pairs |
get_installed_charsets() X-Ref |
returns a list of installed charsets return: array with charset as key and comma-separated list of langs useing the charset as data |
convert($data,$from=False,$to=False) X-Ref |
converts a string $data from charset $from to charset $to param: string/array $data string(s) to convert param: string/boolean $from charset $data is in or False if it should be detected param: string/boolean $to charset to convert to or False for the system-charset the converted string return: string/array converted string(s) from $data |
install_langs($langs,$upgrademethod='dumpold',$only_app=False) X-Ref |
installs translations for the selected langs into the database param: array $langs langs to install (as data NOT keys (!)) param: string $upgrademethod='dumpold' 'dumpold' (recommended & fastest), 'addonlynew' languages, 'addmissing' phrases param: string/boolean $only_app=false app-name to install only one app or default false for all |
autoload_changed_langfiles() X-Ref |
re-loads all (!) langfiles if one langfile for the an app and the language of the user has changed |
get_langs($DEBUG=False) X-Ref |
gets array of installed languages, e.g. array('de','en') param: boolean $DEBUG=false debug messages or not, default not return: array with installed langs |
drop_langs($appname,$DEBUG=False) X-Ref |
delete all lang entries for an application, return True if langs were found param: $appname app_name whose translations you want to delete param: boolean $DEBUG=false debug messages or not, default not return: boolean true if $appname had translations installed, false otherwise |
add_langs($appname,$DEBUG=False,$force_langs=False) X-Ref |
process an application's lang files, calling get_langs() to see what langs the admin installed already param: string $appname app_name of application to process param: boolean $DEBUG=false debug messages or not, default not param: array/boolean $force_langs=false array with langs to install anyway (beside the allready installed ones), or false for none |
write($lang,$app_name,$message_id,$content) X-Ref |
insert/update one phrase in the lang-table param: string $lang param: string $app_name param: string $message_id param: string $content |
read($lang,$app_name,$message_id) X-Ref |
read one phrase from the lang-table param: string $lang param: string $app_name param: string $message_id return: string/boolean content or false if not found |
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |