Localization

This guide helps you set language at run time using a simple cookie. Please ensure that you have an equivalent language pack enabled in CometChat Admin Panel -> Localization.

If you are using Javascript, then your code will be something like:

<script>
// Set Expiry Date
var date = new Date();
date.setTime(date.getTime() + (days*24*60*60*1000));
expires = "; expires=" + date.toUTCString();

// Set Cookie
document.cookie = 'cc_lang' + "=" + 'fr' + expires + "; path=/";
</script>

If you are using PHP, then your code will be something like:

setcookie("cc_lang",'fr',time()+31556926 ,'/');
  • Was this helpful?
  • Yes   No