Stud.IP
4.2 Revision
|
Functions | |
po_escape ($string) | |
po_unescape ($string) | |
po_stringify ($string) | |
get_id ($version, $language, $message, $route, $index, $position) | |
Variables | |
const | MAX_LINE_LENGTH 60 |
if(!isset($_SERVER['argv'], $_SERVER['argc'])|| $_SERVER['argc']< 2) | $opts |
$options = getopt($opts['short'], $opts['long']) | |
$force = isset($options['f']) || isset($options['force']) | |
$version | |
$language = @$options['language'] ?: @$options['l'] ?: mb_substr(Config::get()->DEFAULT_LANGUAGE, 0, 2) | |
$remove = array() | |
foreach(str_split($opts['short']) as $opt) foreach($opts['long'] as $opt) | $_SERVER ['argv'] = array_values(array_diff($_SERVER['argv'], $remove)) |
get_id | ( | $version, | |
$language, | |||
$message, | |||
$route, | |||
$index, | |||
$position | |||
) |
Returns the id for a help entitiy based on the given index and other credentials. This function also copies existing data and settings if the entity in the given language is newly created.
String | $version | Stud.IP version to use for the new entry |
String | $language | Language to use for the new entry |
Array | $message | Complete message item from parsed .po file |
String | $route | Associated route (if any) |
int | $index | Type index for the entity |
int | $position | Position/version of the entity |
po_escape | ( | $string | ) |
Escapes a string for use in .po file.
String | $string | String to escape |
po_stringify | ( | $string | ) |
Prepares a string for use in .po file.
String | $string | String to use in .po file |
po_unescape | ( | $string | ) |
Unescapes a string for use in .po file.
String | $string | String to unescape |
foreach (str_split( $opts[ 'short']) as $opt) foreach ( $opts[ 'long'] as $opt) $_SERVER[ 'argv'] = array_values(array_diff($_SERVER['argv'], $remove)) |
$force = isset($options['f']) || isset($options['force']) |
$language = @$options['language'] ?: @$options['l'] ?: mb_substr(Config::get()->DEFAULT_LANGUAGE, 0, 2) |
$options = getopt($opts['short'], $opts['long']) |
if (!isset( $_SERVER[ 'argv'], $_SERVER[ 'argc'])||$_SERVER[ 'argc']< 2) $opts |
$remove = array() |
$version |
const MAX_LINE_LENGTH 60 |
Exports db data for the help content, tooltips and tours into a .po file or reimports the translated strings into the db.
Since we need to obtain the row to inssert/update the translated content, this information is coded into the corresponding filename and line number.
By using a specific range for line number, we can determine what type the translated string is:
range | context | location | file | line number -----------—+---------—+---------------------—+----—+----------— 10000 - 19999 | - | help_content.label | route | position 20000 - 29999 | content_id | help_content.content | route | position 30000 - 39999 | tour_id | help_tours.name | - | version 40000 - 49999 | tour_id | help_tours.description | - | version 50000 - 59999 | tour_id | help_tour_steps.title | route | step 60000 - 69999 | tour_id | help_tour_steps.tip | route | step 70000 - 79999 | tooltip_id | help_tooltips.content | route | version