Textpattern PHP Cross Reference Content Management Systems

Summary: /textpattern/include/txp_lang.php - 501 lines - 16105 bytes - Source - Print

Description: Languages panel.

Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 8 functions

languages()
list_languages()
save_language()
get_language()
install_lang_key()
get_textpack()
remove_language()
get_lang_files()

Functions

Functions that are not part of a class:

languages($name, $val line: 55
Generate a <select> element of installed languages.

return: string HTML
param: string $name The HTML name and ID to assign to the select control
param: string $val  The currently active language identifier (en-gb, fr-fr, ...)
list_languages($message = '')  line: 83
Generates a <table> of every language that Textpattern supports.

If requested with HTTP POST parameter 'force' set anything other than 'file',
outputs any errors in RPC server connection.

param: string|array $message The activity message
save_language()  line: 298
Saves the active language.

get_language()  line: 329
Installs a language from the RPC server or from a file.

This function fetches language strings for the given language code from
either the RPC server or a file.

Action is taken based on three HTTP POST parameters: 'lang_code', 'force' and
'updating'. The 'lang_code' is the installed langauge, e.g. 'en-gb', 'fi-fi'.
The 'force' when set to 'file' can be used force an installation from a local
file. The 'updating' specifies whether only to install (0) or to update (1).
install_lang_key(&$value, $key line: 396
Writes a new language string to the database.

The language is taken from a 'lang_code' HTTP POST or GET parameter.

The '$value' argument takes a string as an array. This array consists of keys
'name', 'event', 'data', 'uLastmod'.

param: array $value  The string
param: int   $key    Not used
get_textpack()  line: 441
Installs a Textpack.

The Textpack is feeded by a 'textpack' HTTP POST parameter.

remove_language()  line: 456
Remove all language strings for the given lang code.

Removed language code is specified with 'lang_code' HTTP POST
parameter.
get_lang_files()  line: 478
Lists all language files in the 'lang' directory.

return: array Available language filenames

title

Body