@intlayer/core
Version:
Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.
10 lines (8 loc) • 362 B
JavaScript
import { CachedIntl } from "../utils/intl.mjs";
//#region src/localization/getLocaleName.ts
const getLocaleName = (displayLocale, targetLocale = displayLocale) => {
return new CachedIntl.DisplayNames(targetLocale, { type: "language" }).of(displayLocale) ?? "Unknown locale";
};
//#endregion
export { getLocaleName };
//# sourceMappingURL=getLocaleName.mjs.map