Internationalization (i18n)
Overview
Overview of GoLiveKit internationalization.
AI SKILL.md for internationalization
Prompt: Type
/internationalization in your Copilot / Cursor or other chat to use skill with the provided context./internationalization Add translations for the new feature.
Internationalization (i18n)
Work in Progress
This feature partially impmeneted. You can keep messges in .json files and translate your dashboard and other pages. But this parts is still in progress:
- translate emails
- add language switcher to the UI
- translate admin: pages / blogs / tags
GoLiveKit uses next-intl for translations.
- Translations are placed in the
src/shared/messagesfolder. - Locales configuration lives in
src/config/app.tsunder thei18nproperty. - For navigation between pages, always use
Link,redirect,usePathname,useRouter, andgetPathnamefromsrc/lib/i18n/navigation.ts.
Client Component Example
For UI (client) components, use the useTranslations hook:
import {useTranslations} from 'next-intl';
export default function HomePage() {
const t = useTranslations('HomePage');
return <h1>{t('title')}</h1>;
}Server Component Example
In case of async server components, use the awaitable getTranslations function instead:
import {getTranslations} from 'next-intl/server';
export default async function HomePage() {
const t = await getTranslations('HomePage');
return <h1>{t('title')}</h1>;
}