Fai prima a dire:
Codice PHP:
<?php
    
if(isset($_SESSION['cart']) && sizeof($_SESSION['cart']) > 0){
    
?>
       <script type="text/javascript">
        $(document).ready(function(){
            var goingout = false;
            $('#copyright a').click(function(){goingout = true});
            
            window.onbeforeunload = function (evt) {
              var lang = '<?php echo($_SESSION['settings']['language'])?>';
              var message = vocabulary[lang]['general_7'];
              if (typeof evt == 'undefined') {
                evt = window.event;
              }
              if (evt && goingout) {
                evt.returnValue = message;
                return message;
              }
            }
        });
    </script>
    <?php    
    
}
?>
Per quanto riguarda il messaggio, dovresti vedere dove è definito "vocabulary".