Info:
This is documentation for Stream Chat React Native SDK v3, which is no longer actively maintained. For up-to-date documentation, see the latest version (v9).

TranslationContext

TranslationContext is provided by OverlayProvider and Chat components. Read the translations section for more information on how to customize your translations. If you are not familiar with React Context API, please read about it on React docs.

Basic Usage

TranslationContext can be consumed by any of the child component of OverlayProvider or Chat components.

import { useContext } from "react";
import { TranslationContext } from "stream-chat-react-native";

const { t, tDateTimeParser } = useContext(TranslationContext);

Alternatively, you can also use useTranslationContext hook provided by library to consume TranslationContext.

import { useTheme } from "stream-chat-react-native";

const { t, tDateTimeParser } = useTranslationContext();

Value

t

Given a key, extracts the translated text from the Streami18n instance.

Type
function

tDateTimeParser

Used for translating dates and times into the desired local format.

Type
function
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v3: <Your Question>