import { f as LocaleInfo } from './locale.constants-BNkSdNP1.js'; /** * 현재 locale 가져오기 (Server Action) * * 서버/클라이언트 컴포넌트 모두에서 사용 가능 * * 우선순위: * 1. 쿠키 (사용자가 명시적으로 선택한 언어) * 2. 브라우저 언어 감지 (설정에서 활성화된 경우) * 3. 시스템 기본 언어 (CMS 설정) * * @returns 현재 locale (예: 'ko', 'en') * * @example * ```tsx * // Server Component * import { getLocale } from '@spfn/cms/actions'; * * export default async function Page() * { * const locale = await getLocale(); * return
Current locale: {locale}
; * } * ``` * * @example * ```tsx * // Client Component * 'use client'; * import { getLocale } from '@spfn/cms/client'; * * export default function LanguageSwitcher() * { * const [locale, setLocale] = useState(''); * * useEffect(() => { * getLocale().then(setLocale); * }, []); * * return
Current locale: {locale}
; * } * ``` */ declare function getLocale(): Promise; /** * Locale 설정하기 (Server Action) * * 서버/클라이언트 컴포넌트 모두에서 사용 가능 * 쿠키에 locale을 저장합니다. * * @param locale - 설정할 locale (예: 'ko', 'en') * @throws {Error} 지원하지 않는 locale인 경우 * * @example * ```tsx * // Server Component (Server Action) * import { setLocale } from '@spfn/cms/actions'; * * export default async function Page() * { * await setLocale('en'); * return
Locale changed
; * } * ``` * * @example * ```tsx * // Client Component (Server Action) * 'use client'; * import { setLocale } from '@spfn/cms/client'; * * export default function LanguageSwitcher() * { * const handleChange = async (newLocale: string) => * { * await setLocale(newLocale); * window.location.reload(); // 페이지 새로고침 * }; * * return ( * * ); * } * ``` */ declare function setLocale(locale: string): Promise; /** * 지원하는 locale 목록 가져오기 (Server Action) * * 서버/클라이언트 컴포넌트 모두에서 사용 가능 * * @returns 지원하는 locale 배열 (예: ['ko', 'en', 'ja']) * * @example * ```tsx * // Server Component * import { getLocales } from '@spfn/cms/actions'; * * export default async function Page() * { * const locales = await getLocales(); * return
Supported: {locales.join(', ')}
; * } * ``` * * @example * ```tsx * // Client Component * 'use client'; * import { getLocales } from '@spfn/cms/client'; * * export default function LanguageSwitcher() * { * const [locales, setLocales] = useState([]); * * useEffect(() => { * getLocales().then(setLocales); * }, []); * * return ( *
* {locales.map(locale => ( * * ))} *
* ); * } * ``` */ declare function getLocales(): Promise; /** * 현재 locale과 상세 정보 함께 가져오기 (Server Action) * * locale 코드와 함께 국가 코드, 국기, 전화번호 코드 등의 상세 정보를 반환합니다. * * @returns Locale 코드와 LocaleInfo 객체 * * @example * ```tsx * // Server Component * import { getLocaleWithInfo } from '@spfn/cms/actions'; * * export default async function Page() * { * const { locale, info } = await getLocaleWithInfo(); * * return ( *
* {info?.flag} * {info?.nativeName} * {info?.dialCode} *
* ); * } * ``` */ declare function getLocaleWithInfo(): Promise<{ locale: string; info: LocaleInfo | undefined; }>; /** * 지원하는 모든 locale과 상세 정보 가져오기 (Server Action) * * 시스템이 지원하는 모든 locale의 상세 정보를 배열로 반환합니다. * 언어 선택 UI를 만들 때 유용합니다. * * @returns LocaleInfo 배열 * * @example * ```tsx * // Server Component * import { getLocalesWithInfo } from '@spfn/cms/actions'; * * export default async function LanguageSelector() * { * const locales = await getLocalesWithInfo(); * * return ( * * ); * } * ``` */ declare function getLocalesWithInfo(): Promise; export { getLocales as a, getLocaleWithInfo as b, getLocalesWithInfo as c, getLocale as g, setLocale as s };