Translation

Translate the strings of Chat UI

To translate various strings in the UI, you need to pass the translation argument in the init function. Sample code looks like this:

window.ChatCampUi.init({
  appId: APP_ID, 
  user: {
    id: USER_ID,
    displayName: USER_DISPLAY_NAME // optional
  }, 
  ui: {
    theme: {
        primaryBackground: "#3f45ad",
        primaryText: "#ffffff",
        secondaryBackground: "#ffffff",
        secondaryText: "#000000",
        tertiaryBackground: "#f4f7f9",
        tertiaryText: "#263238"
    },
    translation: {
      authenticating: "Authenticating",
      rosterHeader: "My Chats",
      startNewChat: "Create New Group Chat",
      markAsReadAll: "Mark All Channels as Read",
      close: "Close",
      recentChatsTab: "RECENT",
      usersTab: "USERS",
      roomsTab: "ROOM",
      search: "Search...",
      sendMessageInputBox: "Send Message...",
      attachFile: "Attach a File",
      startRecording: "Start Recording",
      stopRecording: "Stop Recording",
      minimize: "Minimize",
      maximize: "Maximize",
      leaveChat: "Leave Chat",
      blockUser: "Block User",
      unblockUser: "Unblock User",
      addParticipants: "Add Participants",
      participantsListHeader: "Participants",
      sendMessageButton: "Send Message",
      online: "Online",
      yesterday: "Yesterday",
      today: "Today",
      justNow: "Just Now",
      minutesShort: "mins ago",
      aMinuteAgo: "a minute ago",
      minutesAgo: "Minutes Ago",
      anHourAgo: "an hour ago",
      hoursAgo: "Hours Ago",
      aDayAgo: "a Day Ago",
      daysAgo: "Days Ago",
      aMonthAgo: "a Month Ago",
      monthsAgo: "Months Ago",
      anYearAgo: "an Year Ago",
      yearsAgo: "Years Ago",
    }
  }
})