changed writeLangFile to cope with multiple messages in one field (separated by '|')

This commit is contained in:
Ralf Becker 2002-06-10 21:30:09 +00:00
parent 36ef7dec78
commit 0728068416

View File

@ -425,6 +425,7 @@
/*! /*!
@function getToTranslate @function getToTranslate
@abstract extracts all texts: labels and helptexts from an eTemplate-object @abstract extracts all texts: labels and helptexts from an eTemplate-object
@note some extensions use a '|' to squezze multiple texts in a label or help field
@returns array with messages as key AND value @returns array with messages as key AND value
*/ */
function getToTranslate() function getToTranslate()
@ -436,13 +437,13 @@
{ {
while (list($col,$cell) = each($cols)) while (list($col,$cell) = each($cols))
{ {
if (strlen($cell['label']) > 1) $all = explode('|',$cell['help'].($cell['type'] != 'image'?'|'.$cell['label']:''));
while (list(,$str) = each($all))
{ {
$to_trans[strtolower($cell['label'])] = $cell['label']; if (strlen($str) > 1)
} {
if (strlen($cell['help']) > 1) $to_trans[strtolower($str)] = $str;
{ }
$to_trans[strtolower($cell['help'])] = $cell['help'];
} }
} }
} }