I've verified that the chatbox module don't work with a localization other than english.
Popup window don't open and shows a 'page not found' error

CommentFileSizeAuthor
#4 chatbox-localization.patch804 bytesdarren oh

Comments

administrador@fidp.net’s picture

I've found what's the problem, but I don't know why happens...
When entering the translation of the string

If the chatbox does not automatically launch, you can <a href="javascript:launchchat();">join the chatbox</a> manually

to any languaje, the substring

javascript:

is deleted...
Anybody knows what's happening?
TIA

adixon’s picture

I don't know why it's doing that, but you probably shouldn't be trying to translate the word 'javascript' anyway. If you use the fancy paramaterized version of the t() function, then it won't mangle it (I'd hope ..).

e.g. replace

t('<p>If the chatbox does not automatically launch, you can <a href="javascript:launchchat();">join the chatbox</a> manually.</p>')

with

'<p>'. t('If the chatbox does not automatically launch, you can %join manually.',array(''%join' => sprintf('<a href="javascript:launchchat();">%s</a>',t('join the chatbox')))).'</p>'

I haven't tested the above (so there might be some syntax errors), but it gives you an idea how to use the t() function in a way that makes translation more straightforward and hopefully solve your problem.

adixon’s picture

okay, i should have read the documentation here:

http://api.drupal.org/api/HEAD/function/t

so the 'right' way is:

<p>'. t('If the chatbox does not automatically launch, you can <a href="%url">join the chatbox</a> manually.',array('%url' => 'javascript:launchchat();')).'</p>'

which is shorter, easier to read and fixes my typo.

darren oh’s picture

Status: Active » Needs review
StatusFileSize
new804 bytes

Here is a patch to test.

darren oh’s picture

Status: Needs review » Fixed

Committed to DRUPAL-4-7 and HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)