UNPKG

@prezly/theme-kit-core

Version:

Data layer and utility library for developing Prezly themes with JavaScript

12 lines (11 loc) 554 B
import { Locale } from '@prezly/theme-kit-intl'; /** * Get the shortest locale code possible from full locale code * First: try shorting to neutral language code (there should be no locales with the same language code) * Then: try shorting to region code (there should be no locales with the same region code) * Finally: return the original locale code (shorting is not possible) */ export declare function getShortestLocaleSlug(locale: Locale.Code, context: { locales: Locale.Code[]; defaultLocale: Locale.Code; }): Locale.AnySlug | false;