Skip to main content

i18n API

Provides API to customize and add multiple language and locale translations for all strings used across App Builder.

i18n : i18nInterface[]

Accepts an array of i18nInterface objects, each specific to a language or locale.

The overrides are applied by passing the array under the top-level i18n key to the Customization API config object.

i18nInterface

KeyTypeDescription
localestringUnique string identifier to specify a language.
label?stringLanguage name to display in the UI dropdown
datai18nDataInterfaceThe necessary translations for a given locale

i18nDataInterface

KeyTypeDescriptionDefaults
meetingNameInputPlaceholder?I18nBaseTypePlaceholder text for the meeting name input fieldName your meeting
pstnUserLabel?I18nBaseTypeLabel for the PSTN userPSTN User
joinRoomButton?I18nBaseType<JoinRoomButtonTextInterface>Label for the join room button on precall screenJoin room

App Builder ships with en-us out of the Box. Providing an object with en-us as it's locale will replace the default strings

When there are two or more translations in the App(including the default en-us), A dropdown language selector will be display in both the precall screen as well as the settings panel.


Usage:

Use the example code given below showcasing overrding

import React from "react";
import { customize } from "customization-api";

const userCustomization = customize({
i18n: [
{
locale: "en-us",
label: "English US",
data: {
meetingNameInputPlaceholder: "Name your Room",
pstnUserLabel: "Dial In User",
joinRoomButton: ({ ready, role }) =>
ready
? !role
? "Join Room"
: `Join Room as ${
role === ClientRole.Broadcaster ? "Host" : "Audience"
}`
: `Loading...`,
},
},
{
locale: "es",
label: "Español",
data: {
meetingNameInputPlaceholder: "Nombra tu habitación",
},
},
],
});

export default userCustomization;


TYPES


I18nBaseType<T> : string | ((template: T) => string)

I18nDynamicType : I18nBaseType<string>

JoinRoomButtonTextInterface

KeyTypeDescription
readybooleanBoolean that indicates whether a room is ready to be joined
roleClientRoleRole of the user trying to join

ClientRole

IndexNameDescription
1BroadcasterUser publishes to other channel boradcasters and Audience members
2AudienceUser subscribing to other channel broadcasters without publishes