UNPKG

@prezly/theme-kit-core

Version:

Data layer and utility library for developing Prezly themes with JavaScript

16 lines (15 loc) 620 B
import { Locale } from '@prezly/theme-kit-intl'; /** * Match the requested locale slug against the enabled locales. * The enabled locales have to be provided in the order of importance: * default first, then locales with public stories, then the rest. * * The logic is reversed from `getShortestLocaleSlug`, so that it "unwraps" the possible variants. * @see {getShortestLocaleSlug()} * * The order of checks is: * - exact locale slug match * - match by language code * - match by region code */ export declare function matchLocaleSlug(slug: Locale.AnySlug, locales: Locale.Code[]): Locale.Code | undefined;