Forums / Developer / Simple quotes on translations and javascript

Simple quotes on translations and javascript

Author Message

Sergi A

Thursday 29 April 2010 1:09:56 am

Hi!

i'm using ezmultiupload extension and I have a little problem with this tpl:

extension/ezmultiupload/design/standard/templates/ezmultiupload/upload.tpl

the code where some javascript string variables are being set, there is a TPL code that uses the i18n operator and assigns the returned string to a variable (lines 37-50).

YAHOO.ez.MultiUpload.cfg = {ldelim} 
                              swfURL:'{'javascript/yui/2.7.0/build/uploader/assets/uploader.swf'|ezdesign( 'no' )}', 
                              uploadURL: '{concat( 'ezmultiupload/upload/', $parent_node. node_id )|ezurl( 'no' )}', 
                              uploadVars: {ldelim}  
                                              '{$session_name}': '{$session_id}', 
                                              'UserSessionHash': '{$user_session_hash}', 
                                              'UploadButton': 'Upload' 
                                          {rdelim}, 
                              fileType: '{$file_types}', 
                              progressBarWidth: '300', 
                              allFilesRecived: '{'All files received.'|i18n('extension/ezmultiupload')}', 
                              uploadCanceled: '{'Upload canceled.'|i18n('extension/ezmultiupload')}', 
                              thumbnailCreated: '{'Thumbnail created.'|i18n('extension/ezmultiupload')}' 
                           {rdelim};

The problem is that Catalan language has the ' character and it appears in these translations, so it breaks the javascript string leading to a malfunction.

The solution would be a tpl operator that replaces the ' character with '' (double simple quote) so that it doesn't interferes with the js string. But i can't find this operator...

did anybody find this problem?

Sergi.