"Enable localization" causes XSP.addOnLoad() is not executed

I want to create a view picklist and use the sample code in wiki.

It runs but when I enable “Enable localization” in Application Properities, XSP.addOnLoad() is not executed.

<script language="Javascript">

	XSP.addOnLoad(function(){dialog_create('Dialog1','dialog')});

</script>

Any ideas and comments are welcome.

Regards