c77d0a8e89
Build & Push / Build & Push Docker Image (push) Failing after 10m39s
Replace storefront naming across source, tests, docs, config, and production scripts. Rename the legacy top-level app directory and Carplace component files, remove duplicate storefront startup scripts, and refresh the lockfile.
11 lines
467 B
TypeScript
11 lines
467 B
TypeScript
import { cookies } from 'next/headers'
|
|
import { MARKETPLACE_LANGUAGE_COOKIE, SHARED_LANGUAGE_COOKIE, isCarplaceLanguage, type CarplaceLanguage } from './i18n'
|
|
|
|
export async function getCarplaceLanguage(): Promise<CarplaceLanguage> {
|
|
const cookieStore = await cookies()
|
|
const cookieValue =
|
|
cookieStore.get(SHARED_LANGUAGE_COOKIE)?.value ??
|
|
cookieStore.get(MARKETPLACE_LANGUAGE_COOKIE)?.value
|
|
return isCarplaceLanguage(cookieValue) ? cookieValue : 'en'
|
|
}
|