bc = window.bc || {}; bc.lng = (function() { var messages = {}, currentLanguage = 'en-US', changingLanguage = false, availableLanguages = 'ko-KR,nl-NL,pt-BR,de-DE,it-IT,en-US,es-ES,ja-JP,fr-FR'; function getMessage(token, params) { var message = messages[token] || ('####' + token + '###'); if (params) { for (var key in params) { message = message.replace('#' + key + '#', params[key]); } } return message; } function addMessage(token, message) { messages[token] = message; } function changeLanguage(languageCode) { if (currentLanguage == languageCode || availableLanguages.indexOf(languageCode) == -1) { return; } // do not use yahoo cookie because setup also uses this util.jsp bc.util.setCookie('lang', languageCode); bc.util.setCookie('forcelang', languageCode); doReload(); } function doReload() { // IE throws exception when window unload canceled try { changingLanguage = true; window.location.reload(true); } catch(e) { changingLanguage = false; } } return { getMessage: getMessage, addMessage: addMessage, changeLanguage: changeLanguage, currentLanguage: currentLanguage, changingLanguage: function () { return changingLanguage; } } }()); bc.lng.addMessage('general#dateformat#precision#day#singular', '#days# day'); bc.lng.addMessage('general#dateformat#precision#day#plural', '#days# days'); // manager exceptions bc.lng.addMessage('localchatmanager#error#alreadyassigned', 'Unable to answer because chat is already assigned to a different operator or has ended.'); bc.lng.addMessage('localclientmanager#error#passwordreuseaftergenerations', 'You cannot reuse this old password.'); bc.lng.addMessage('localclientmanager#error#toomanypasswordchanges', 'Password not saved. You changed your password too frequently.');