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
Key | Type | Description |
---|---|---|
locale | string | Unique string identifier to specify a language. |
label? | string | Language name to display in the UI dropdown |
data | i18nDataInterface | The necessary translations for a given locale |
i18nDataInterface
Key | Type | Description | Defaults |
---|---|---|---|
meetingNameInputPlaceholder? | I18nBaseType | Placeholder text for the meeting name input field | Name your meeting |
pstnUserLabel? | I18nBaseType | Label for the PSTN user | PSTN User |
joinRoomButton? | I18nBaseType<JoinRoomButtonTextInterface> | Label for the join room button on precall screen | Join 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
I18nDynamicType : I18nBaseType<string>
JoinRoomButtonTextInterface
Key | Type | Description |
---|---|---|
ready | boolean | Boolean that indicates whether a room is ready to be joined |
role | ClientRole | Role of the user trying to join |