[Dotproject-cvs] Array support in translations
Brought to you by:
ajdonnison,
kchisholm
|
From: Adam D. <ad...@sa...> - 2005-04-08 07:55:57
|
In order to assist those areas where there is static text combined
with dynamic data in translations, the translation function now
supports the use of arrays.
If an array is passed to the translation, each part of the array
is translated separately and then concatenated together with a space
between each string.
So, for instance you can do:
$AppUI->_(array('Error:', $db->ErrorMsg()));
This would translate the 'Error:' bit first, then the error message
from the database (which won't normally be translated anyway).
I've used this for things like messages from CTask::store which
was using things like BadDep_NoDynDep which made no sense to
anyone. It now returns the fully translated strings, even if they
have dynamic data attached, like the task id, and you don't need to
use $AppUI->_ everywhere you need a part of a string translated.
Hope this makes sense and is of some use.
Adam
--
Adam Donnison email: ad...@sa...
Saki Computer Services Pty. Ltd.
93 Kallista-Emerald Road phone: +61 3 9752 1512
THE PATCH VIC 3792 AUSTRALIA fax: +61 3 9752 1098
|