UNPKG

@prezly/theme-kit-core

Version:

Data layer and utility library for developing Prezly themes with JavaScript

21 lines (20 loc) 805 B
import type { Culture, NewsroomLanguageSettings } from '@prezly/sdk'; type MinCulture = Pick<Culture, 'code' | 'native_name'>; type MinLanguage = { locale: Pick<NewsroomLanguageSettings['locale'], 'code' | 'native_name'>; }; /** * @returns the display name of the locale in its native language * * If there's only one culture used in a specific language, * we strip the culture name completely. * * Examples: * - English (Global), Spanish (Spain) * - -> English, Spanish * - English (Global), English (UK), Spanish (Spain) * - -> English (Global), English (UK), Spanish */ export declare function getLanguageDisplayName(subject: MinCulture, context: MinCulture[]): string; export declare function getLanguageDisplayName(subject: MinLanguage, context: MinLanguage[]): string; export {};