Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / resolveLocalePath

Function: resolveLocalePath()

resolveLocalePath(pathname, routing): LocalePath

Which language a request is for, and the path it renders. A first segment that is a published language other than the primary selects it; the primary's own prefix redirects, and so does any prefix on a page that exists in the primary language only (isSingleLanguagePage: /fr/lp/x → /lp/x); anything else — an unpublished or unknown code included — is an ordinary path in the primary language, so it renders or 404s exactly as before.

Parameters

pathname

string

routing

LocaleRouting

Returns

LocalePath