🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
import { setCookie } from '@lobechat/utils';
import { changeLanguage } from 'i18next';
import { LOBE_LOCALE_COOKIE } from '@/const/locale';
import { type LocaleMode } from '@/types/locale';
import { getSystemLanguage } from '@/utils/client/systemLanguage';
export const resolveLang = (locale: LocaleMode) =>
locale === 'auto' ? getSystemLanguage() : locale;
export const switchLang = (locale: LocaleMode) => {
const lang = resolveLang(locale);
changeLanguage(lang);
document.documentElement.lang = lang;
setCookie(LOBE_LOCALE_COOKIE, locale === 'auto' ? undefined : locale, 365);
};