Hi Andrew,
I've currently found two places, where either the call to "translate" is
missing or the call to i18n is IMHO wrong.
1.) in DAViCalUser.php, there's a call to translate missing and therefore
"Delete User" does not get translated;
at line 93 you wrote:
------------------------------------------------------------------------
$html .= sprintf('<a class="fsubmit"
href="%s/usr.php?user_no=%s&action=delete_user">Delete User</a>',
$c->base_url, $this->user_no );
------------------------------------------------------------------------
and I write:
------------------------------------------------------------------------
$html .= sprintf('<a class="fsubmit"
href="%s/usr.php?user_no=%s&action=delete_user">%s</a>', $c->base_url,
$this->user_no, translate('Delete User') );
------------------------------------------------------------------------
2.) in drivers_ldap.php in method sync_LDAP (and other methods as well)
are a lot of places where you call i18n to a sprintf format string which
then gets added to the $c->messages array.
I assume that later another method prints out the strings from the messages
array and sents the strings through the translate function.
But this will not work - the gettext library does only know about the
format string and not the string with extracted variables.
So I think all that places in drivers_ldap.php should be changed to directly
call "translate" instead of "i18n" to make it work.
Another possibility would be to distinguish between format strings and
parameters and store them separately in a multi dimensional array
Like follows:
$c->messages[] = array( 'format' -> i18n("text with params %s, %s"),
'params' -> array( $param1, $param2 ) );
After that you could send the format string through the translate function
and put the whole string together afterwards...
I hope the above lines are understandable...
regards,
Matthias
I've currently found two places, where either the call to "translate" is
missing or the call to i18n is IMHO wrong.
1.) in DAViCalUser.php, there's a call to translate missing and therefore
"Delete User" does not get translated;
at line 93 you wrote:
------------------------------------------------------------------------
$html .= sprintf('<a class="fsubmit"
href="%s/usr.php?user_no=%s&action=delete_user">Delete User</a>',
$c->base_url, $this->user_no );
------------------------------------------------------------------------
and I write:
------------------------------------------------------------------------
$html .= sprintf('<a class="fsubmit"
href="%s/usr.php?user_no=%s&action=delete_user">%s</a>', $c->base_url,
$this->user_no, translate('Delete User') );
------------------------------------------------------------------------
2.) in drivers_ldap.php in method sync_LDAP (and other methods as well)
are a lot of places where you call i18n to a sprintf format string which
then gets added to the $c->messages array.
I assume that later another method prints out the strings from the messages
array and sents the strings through the translate function.
But this will not work - the gettext library does only know about the
format string and not the string with extracted variables.
So I think all that places in drivers_ldap.php should be changed to directly
call "translate" instead of "i18n" to make it work.
Another possibility would be to distinguish between format strings and
parameters and store them separately in a multi dimensional array
Like follows:
$c->messages[] = array( 'format' -> i18n("text with params %s, %s"),
'params' -> array( $param1, $param2 ) );
After that you could send the format string through the translate function
and put the whole string together afterwards...
I hope the above lines are understandable...
regards,
Matthias