UNPKG

@atlaskit/focused-task-close-account

Version:

This package contains all of the UI components needed to assemble the focused tasks for deactivating and deleting users' accounts in accordance with the GDPR "Right to be forgotten".

59 lines (57 loc) 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMessagesForLocale = void 0; var _i18n = require("../i18n"); var localesMessagesMap = { cs: _i18n.cs, da: _i18n.da, de: _i18n.de, en: _i18n.en, en_GB: _i18n.en_GB, en_ZZ: _i18n.en_ZZ, es: _i18n.es, et: _i18n.et, fi: _i18n.fi, fr: _i18n.fr, hu: _i18n.hu, is: _i18n.is, it: _i18n.it, ja: _i18n.ja, ko: _i18n.ko, nb: _i18n.nb, nl: _i18n.nl, pl: _i18n.pl, pt_BR: _i18n.pt_BR, 'pt-BR': _i18n.pt_BR, // should resolve pt-BR and pt_BR pt_PT: _i18n.pt_PT, 'pt-PT': _i18n.pt_PT, ro: _i18n.ro, ru: _i18n.ru, sk: _i18n.sk, sv: _i18n.sv, zh: _i18n.zh }; /** * Tries to get the most specific messages bundle for a given locale. * * Strategy: * 1. Try to find messages with the exact string (i.e. 'fr_FR') * 2. If that doesn't work, try to find messages for the country locale (i.e. 'fr') * 3. If that doesn't work, return english messages as a fallback. * * @param locale string specifying the locale like 'en_GB', or 'fr'. */ var getMessagesForLocale = exports.getMessagesForLocale = function getMessagesForLocale(locale) { var messages = localesMessagesMap[locale]; if (!messages) { var parentLocale = locale.split(/[-_]/)[0]; messages = localesMessagesMap[parentLocale]; } if (!messages) { messages = _i18n.en; } return messages; };