Is it possible to use language files on javascript?

Started by Rich, November 29, 2013, 01:59:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rich

#1
As the title says it it possible to make use of the language files for eg. the code below which is taken from forum_manage.php I've tried various combinations and I can get it to display the correct text using $lang but when clicking on delete it won't bring up the popup box asking for confirmation.

<script type="text/javascript">
<!--
function confirm_delete(id)
{
   if(confirm(\'Are you sure you want to delete this forum?\'))
   {
      self.location.href=\'staffpanel.php?tool=forum_manage&amp;action=forum_manage&action2=delete&id=\'+id;
   }
}
//-->
</script>';


I've tried:-

if (confirm('$lang['text_conf_delete']'))
if (confirm(<?php echo $lang['text_conf_delete']?>))
if (confirm("".$lang['text_conf_delete'].""))


I've even searched through the v3 source and noticed that none of the files that are using the above or similar are making use of languages!