mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-18 19:44:21 +00:00
21 lines
535 B
TypeScript
21 lines
535 B
TypeScript
'use client';
|
|
|
|
import { ReactNode } from 'react';
|
|
import '@/i18n';
|
|
import { I18nLabel } from '@/app/infra/entities/common';
|
|
|
|
interface I18nProviderProps {
|
|
children: ReactNode;
|
|
}
|
|
|
|
export default function I18nProvider({ children }: I18nProviderProps) {
|
|
return <>{children}</>;
|
|
}
|
|
export function i18nObj(i18nLabel: I18nLabel): string {
|
|
const language = localStorage.getItem('langbot_language');
|
|
if ((language === 'zh-Hans' && i18nLabel.zh_Hans) || !i18nLabel.en_US) {
|
|
return i18nLabel.zh_Hans;
|
|
}
|
|
return i18nLabel.en_US;
|
|
}
|