Localization
  • 19 Jun 2023
  • 2 Minutes à lire
  • Sombre
    Lumière
  • PDF

Localization

  • Sombre
    Lumière
  • PDF

The content is currently unavailable in French. You are viewing the default English version.
Résumé de l’article

The Cobrowse experience is supported in multiple languages.

Adding Locale data

To add another language

window.Cobrowse.modal.addL18nLocale(localNames: string[], values: {  [keywords: string]: string })

Example

// example for adding French locales "fr" and "fr-CA"
window.Cobrowse.modal.commandQueue.push(async () => {
  const frLocaleData = {
      START_CB_PROMPT: 'Entrez votre NIP pour démarrer une session de co-navigation',
      CAPTCHA_PROMPT: 'Entrez les chiffres de l\'image ci-dessous',
      ACCEPT_CB_BUTTON: 'Acceptez',
      REJECT_CB_BUTTON: 'Rejeter',
      ENTER_CB_CAPTCHA_BUTTON: 'Entrer',
      END_CB_BUTTON: 'Fin',
      CB_SESSION_INFO: 'Vous êtes dans une session de co-navigation',
      ACCEPT_PERMISSION_BUTTON: 'Acceptez',
      DENY_PERMISSION_BUTTON: 'Nier',
      LASERPOINTER_DIALOG: 'a demandé la permission de dessiner un pointeur laser sur votre écran',
      HIGHLIGHTER_DIALOG: 'a demandé la permission de dessiner avec un surligneur sur votre écran',
      VIDEO_CHAT_DIALOG: "a demandé l'autorisation de démarrer une session de chat vidéo",
      INVALID_PIN_PROMPT: 'Cette broche était invalide, veuillez retaper votre broche',
      BAD_CAPTCHA_PROMPT: 'Veuillez réessayer',
      SCOPE_EXPLANATION: 'Une session de co-navigation ne partage que ce site Web avec un agent',
      PRIVACY_EXPLANATION:
    "Les éléments en surbrillance contenant cette icône de verrou sont confidentiels et ne sont pas visibles par l'agent de navigation simultanée.",
      UNSUPPORTED_BROWSER_EXIT_BUTTON: 'Fermer ScreenMeet',
      UNSUPPORTED_BROWSER_PROMPT: "Désolé! ScreenMeet n'est pas pris en charge dans ce navigateur",
      CONFIDENTIAL: 'Confidentiel',
      AUTO_POPUP_PROMPT: 'Vous êtes sur le point de démarrer une session Cobrowse avec un agent, acceptez-vous?'
  };
  window.Cobrowse.modal.addL18nLocale(["fr","fr-CA"], frLocaleData)
})

Manually set locale

By default Cobrowse will use the “lang” attribute of the page html tag to switch languages. However, if necessary it can be switched manually using the following function.

window.Cobrowse.modal.setLocale(locale: string);

Default

const defaultLocaleData = {
  START_CB_PROMPT: "Enter your pin to start a co-browse session",
  CAPTCHA_PROMPT: "Enter the numbers from the image below",
  UNSUPPORTED_BROWSER_PROMPT: "Sorry! Cobrowse is not supported in this browser",
  ACCEPT_CB_BUTTON: "Accept",
  REJECT_CB_BUTTON: "Reject",
  ENTER_CB_CAPTCHA_BUTTON: "Enter",
  END_CB_BUTTON: "End",
  CB_SESSION_INFO: "You are in a co-browse session",
  ACCEPT_PERMISSION_BUTTON: "Accept",
  DENY_PERMISSION_BUTTON: "Deny",
  LASERPOINTER_DIALOG: "has requested permission to draw a laser pointer on your screen",
  HIGHLIGHTER_DIALOG: "has requested permission to draw with a highlighter on your screen",
  VIDEO_CHAT_DIALOG: "has requested permission to start a video chat session",
  REMOTE_CONTROL_DIALOG: "has requested permission to start remote controlling the page",
  REMOTE_CLICK_DIALOG: "has requested permission to click elements on the page",
  REMOTE_FORM_FILL_DIALOG: "has requested permission to fillout forms on the page",
  UNSUPPORTED_BROWSER_EXIT_BUTTON: "Close Cobrowse",
  INVALID_PIN_PROMPT: "That pin was invalid, please retype your pin",
  BAD_CAPTCHA_PROMPT: "Please try again.",
  SCOPE_EXPLANATION: "A co-browse session shares only this website with an agent",
  PRIVACY_EXPLANATION: "Elements highlighted containing this lock icon are confidential and not visible to the co-browse agent",
  CB_CONNECTION_ERROR: "Could not establish a connection to Cobrowse. Ensure WebSockets are available",
  FILE_TRANSFER_TITLE: "File Transfer",
  FILE_UPLOAD: "Drag & Drop to upload files or click here",
  FILE_NAME: "File",
  FILE_SIZE: "Size",
  FILE_UPLOADER: "Uploader",
  UPLOAD: "Uploading...",
  CANCEL_UPLOAD: "Cancel upload",
  CONFIDENTIAL: "Confidential",
  AUTO_POPUP_PROMPT: "You are about to start a Cobrowse session with an agent, do you accept?"
};
window.Cobrowse.modal!.addL18nLocale(["en","en-us"], defaultLocaleData);



Cet article vous a-t-il été utile ?