Chat UIKit React Native v2
Chat UIKit React Native
Chat UIKit
React Native
Version 2

String resource

Copy link

The StringSet interface contains all strings that appear on UIKit modules. The following table shows all the elements of StringSet.

CategoryKeyString

Group channel list

GROUP_CHANNEL_LIST.HEADER_TITLE

Channels

Group channel list

GROUP_CHANNEL_LIST.DIALOG_CHANNEL_NOTIFICATION

Turn on notifications
Turn off notifications

Group channel list

GROUP_CHANNEL_LIST.DIALOG_CHANNEL_LEAVE

Leave channel

Group channel

GROUP_CHANNEL.LIST_BANNER_FROZEN

Channel is frozen

Group channel

GROUP_CHANNEL.LIST_BUTTON_NEW_MSG

${number} new messages

Group channel

GROUP_CHANNEL.MESSAGE_BUBBLE_EDITED_POSTFIX

(edited)

Group channel

GROUP_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_TITLE

(Unknown message type)

Group channel

GROUP_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_DESC

Cannot read this message.

Group channel settings

GROUP_CHANNEL_SETTINGS.HEADER_TITLE

Channel information

Group channel settings

GROUP_CHANNEL_SETTINGS.HEADER_RIGHT

Edit

Group channel settings

GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION

Notifications

Group channel settings

GROUP_CHANNEL_SETTINGS.MENU_MEMBERS

Members

Group channel settings

GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL

Leave channel

Group channel settings

GROUP_CHANNEL_SETTINGS.MENU_MODERATION

Moderation

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME

Change channel name

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_TITLE

Change channel name

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER

Enter name

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_OK

Save

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_CANCEL

Cancel

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE

Change channel image

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_TITLE

Change channel image

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_CAMERA

Take photo

Group channel settings

GROUP_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_PHOTO_LIBRARY

Choose photo

Group channel members

GROUP_CHANNEL_MEMBERS.HEADER_TITLE

Members

Group channel create

GROUP_CHANNEL_CREATE.HEADER_TITLE

New channel

Group channel create

GROUP_CHANNEL_CREATE.HEADER_RIGHT

Create
Create (${number})

Group channel invite

GROUP_CHANNEL_INVITE.HEADER_TITLE

Invite users

Group channel invite

GROUP_CHANNEL_INVITE.HEADER_RIGHT

Invite
Invite (${number})

Group channel moderation

GROUP_CHANNEL_MODERATION.HEADER_TITLE

Moderation

Group channel moderation

GROUP_CHANNEL_MODERATION.MENU_OPERATORS

Operators

Group channel moderation

GROUP_CHANNEL_MODERATION.MENU_MUTED_MEMBERS

Muted members

Group channel moderation

GROUP_CHANNEL_MODERATION.MENU_BANNED_USERS

Banned users

Group channel moderation

GROUP_CHANNEL_MODERATION.MENU_FREEZE_CHANNEL

Freeze channel

Group channel operators

GROUP_CHANNEL_OPERATORS.HEADER_TITLE

Operators

Group channel register operators

GROUP_CHANNEL_REGISTER_OPERATOR.HEADER_TITLE

Set as operators

Group channel register operators

GROUP_CHANNEL_REGISTER_OPERATOR.HEADER_RIGHT

Add
Add (${number})

Group channel muted members

GROUP_CHANNEL_MUTED_MEMBERS.HEADER_TITLE

Muted members

Group channel banned users

GROUP_CHANNEL_BANNED_USERS.HEADER_TITLE

Banned users

Open channel

OPEN_CHANNEL.HEADER_SUBTITLE

${number} participants

Open channel

OPEN_CHANNEL.LIST_BANNER_FROZEN

Channel is frozen

Open channel

OPEN_CHANNEL.MESSAGE_BUBBLE_EDITED_POSTFIX

(edited)

Open channel

OPEN_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_TITLE

(Unknown message type)

Open channel

OPEN_CHANNEL.MESSAGE_BUBBLE_UNKNOWN_DESC

Can't read this message.

Open channel participants

OPEN_CHANNEL_PARTICIPANTS.HEADER_TITLE

Participants

Open channel settings

OPEN_CHANNEL_SETTINGS.HEADER_TITLE

Channel information

Open channel settings

OPEN_CHANNEL_SETTINGS.HEADER_RIGHT

Edit

Open channel settings

OPEN_CHANNEL_SETTINGS.INFO_URL

URL

Open channel settings

OPEN_CHANNEL_SETTINGS.MENU_MODERATION

Moderation

Open channel settings

OPEN_CHANNEL_SETTINGS.MENU_PARTICIPANTS

Participants

Open channel settings

OPEN_CHANNEL_SETTINGS.MENU_DELETE_CHANNEL

Delete channel

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANNEL_DELETE_CONFIRM_TITLE

Delete channel?

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANNEL_DELETE_CONFIRM_OK

Delete

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANNEL_DELETE_CONFIRM_CANCEL

Cancel

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME

Change channel name

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_TITLE

Change channel name

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_PLACEHOLDER

Enter name

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_OK

Save

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_NAME_PROMPT_CANCEL

Cancel

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE

Change channel image

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_TITLE

Change channel image

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_CAMERA

Take photo

Open channel settings

OPEN_CHANNEL_SETTINGS.DIALOG_CHANGE_IMAGE_MENU_PHOTO_LIBRARY

Choose photo

Open channel list

OPEN_CHANNEL_LIST.HEADER_TITLE

Channels

Open channel create

OPEN_CHANNEL_CREATE.HEADER_TITLE

New channel

Open channel create

OPEN_CHANNEL_CREATE.HEADER_RIGHT

Create

Open channel create

OPEN_CHANNEL_CREATE.PLACEHOLDER

Enter channel name

Open channel create

OPEN_CHANNEL_CREATE.DIALOG_IMAGE_MENU_REMOVE

Remove photo

Open channel create

OPEN_CHANNEL_CREATE.DIALOG_IMAGE_MENU_CAMERA

Take photo

Open channel create

OPEN_CHANNEL_CREATE.DIALOG_IMAGE_MENU_PHOTO_LIBRARY

Choose photo

Open channel moderation

OPEN_CHANNEL_MODERATION.HEADER_TITLE

Moderation

Open channel moderation

OPEN_CHANNEL_MODERATION.MENU_OPERATORS

Operators

Open channel moderation

OPEN_CHANNEL_MODERATION.MENU_MUTED_PARTICIPANTS

Muted participants

Open channel moderation

OPEN_CHANNEL_MODERATION.MENU_BANNED_USERS

Banned users

Open channel banned users

OPEN_CHANNEL_BANNED_USERS.HEADER_TITLE

Banned users

Open channel muted participants

OPEN_CHANNEL_MUTED_PARTICIPANTS.HEADER_TITLE

Muted participants

Open channel operators

OPEN_CHANNEL_OPERATORS.HEADER_TITLE

Operators

Open channel register operator

OPEN_CHANNEL_REGISTER_OPERATOR.HEADER_TITLE

Set as operators

Open channel register operator

OPEN_CHANNEL_REGISTER_OPERATOR.HEADER_RIGHT

Add
Add (${number})

Labels

LABELS.USER_NO_NAME

(No name)

Labels

LABELS.TYPING_INDICATOR_TYPINGS

${string} is typing...
${string} and ${string} are typing...
Several people are typing...

Labels

LABELS.REGISTER_AS_OPERATOR

Register as operator

Labels

LABELS.UNREGISTER_OPERATOR

Unregister operator

Labels

LABELS.MUTE

Mute

Labels

LABELS.UNMUTE

Unmute

Labels

LABELS.BAN

Ban

Labels

LABELS.UNBAN

Unban

Labels

LABELS.CHANNEL_INPUT_PLACEHOLDER_ACTIVE

Enter message

Labels

LABELS.CHANNEL_INPUT_PLACEHOLDER_DISABLED

Chat not available in this channel.

Labels

LABELS.CHANNEL_INPUT_PLACEHOLDER_MUTED

You're muted by the operator.

Labels

LABELS.CHANNEL_INPUT_EDIT_OK

Save

Labels

LABELS.CHANNEL_INPUT_EDIT_CANCEL

Cancel

Labels

LABELS.CHANNEL_INPUT_ATTACHMENT_CAMERA

Camera

Labels

LABELS.CHANNEL_INPUT_ATTACHMENT_PHOTO_LIBRARY

Photo library

Labels

LABELS.CHANNEL_INPUT_ATTACHMENT_FILES

Files

Labels

LABELS.CHANNEL_MESSAGE_COPY

Copy

Labels

LABELS.CHANNEL_MESSAGE_EDIT

Edit

Labels

LABELS.CHANNEL_MESSAGE_SAVE

Save

Labels

LABELS.CHANNEL_MESSAGE_DELETE

Delete

Labels

LABELS.CHANNEL_MESSAGE_DELETE_CONFIRM_TITLE

Delete this message?

Labels

LABELS.CHANNEL_MESSAGE_DELETE_CONFIRM_OK

Delete

Labels

LABELS.CHANNEL_MESSAGE_DELETE_CONFIRM_CANCEL

Cancel

Labels

LABELS.CHANNEL_MESSAGE_RETRY

Retry

Labels

LABELS.CHANNEL_MESSAGE_REMOVE

Remove

Labels

LABELS.USER_BAR_ME_POSTFIX

(You)

Labels

LABELS.USER_BAR_OPERATOR

Operator

Placeholder

PLACEHOLDER.NO_CHANNELS

No channels

Placeholder

PLACEHOLDER.NO_MESSAGES

No messages

Placeholder

PLACEHOLDER.NO_MUTED_MEMBERS

No muted members

Placeholder

PLACEHOLDER.NO_BANNED_USERS

No banned users

Placeholder

PLACEHOLDER.NO_RESULTS_FOUND

No results founds

Placeholder

PLACEHOLDER.ERROR.MESSAGE

Something went wrong

Placeholder

PLACEHOLDER.ERROR.RETRY_LABEL

Retry

Placeholder

PLACEHOLDER.NO_MUTED_PARTICIPANTS

No muted participants

Dialog

DIALOG.ALERT_DEFAULT_OK

Ok

Dialog

DIALOG.PROMPT_DEFAULT_OK

Submit

Dialog

DIALOG.PROMPT_DEFAULT_CANCEL

Cancel

Dialog

DIALOG.PROMPT_DEFAULT_PLACEHOLDER

Enter

Toast

TOAST.COPY_OK

Copied

Toast

TOAST.DOWNLOAD_START

Downloading...

Toast

TOAST.DOWNLOAD_OK

File saved

Toast

TOAST.DOWNLOAD_ERROR

Couldn't download file.

Toast

TOAST.OPEN_CAMERA_ERROR

Couldn't open camera.

Toast

TOAST.OPEN_FILES_ERROR

Couldn't open files.

Toast

TOAST.OPEN_PHOTO_LIBRARY_ERROR

Couldn't open photo library.

Toast

TOAST.DELETE_MSG_ERROR

Couldn't delete message.

Toast

TOAST.RESEND_MSG_ERROR

Couldn't send message.

Toast

TOAST.SEND_MSG_ERROR

Couldn't send message.

Toast

TOAST.UPDATE_MSG_ERROR

Couldn't edit message.

Toast

TOAST.TURN_ON_NOTIFICATIONS_ERROR

Couldn't turn on notifications.

Toast

TOAST.TURN_OFF_NOTIFICATIONS_ERROR

Couldn't turn off notifications.

Toast

TOAST.LEAVE_CHANEL_ERROR

Couldn't leave channel.

Toast

TOAST.UNKNOWN_ERROR

Something went wrong.

Toast

TOAST.GET_CHANNEL_ERROR

Couldn't retrieve channel.


Customize the StringSet

Copy link

You can customize each string in the StringSet by creating a new custom StringSet with the createBaseStringSet method. For strings used in dates, you can pass the locale object of the date-fns library and the text as a parameter to each dateLocale and overrides prop in UIKit. The default language for all texts are English.

import { View } from 'react-native';
import dateLocale from 'date-fns/locale/ko';
import { StringSetEn, createBaseStringSet, SendbirdUIKitContainer, useLocalization } from '@sendbird/uikit-react-native';
import { Text, Button } from '@sendbird/uikit-react-native-foundation';

const StringSetKo = createBaseStringSet({
    dateLocale,
    overrides: {
        LABELS: {
            USER_NO_NAME: '(이름없음)',
            TYPING_INDICATOR_TYPINGS: (users) => {
                if (users.length === 0) return '';
                return `${users.length}명이 입력중...`;
            },
        },
        // ...
    },
});

const StringSets = {
    'en': StringSetEn,
    'ko': StringSetKo,
};

const App = () => {
    const { locale, setLocale } = useMyLocale();
    return (
        <SendbirdUIKitContainer localization={{ stringSet: StringSets[locale] }}>
            <Navigations />
        </SendbirdUIKitContainer>
    );
};

const SwitchLanguageButton = () => {
    const { locale, setLocale } = useMyLocale();
    const { STRINGS } = useLocalization();
    const nextLocale = locale === 'en' ? 'ko' : 'en';

    return (
        <View>
            <Button onPress={() => setLocale(nextLocale)}>{`Change to ${nextLocale}`}</Button>
            <Text>{STRINGS.LABELS.USER_NO_NAME}</Text>
        </View>
    );
};