{"version":3,"file":"i18n.js","sources":["../../src/govuk/i18n.mjs"],"sourcesContent":["/**\n * Internal support for selecting messages to render, with placeholder\n * interpolation and locale-aware number formatting and pluralisation\n *\n * @class\n * @private\n * @param {Object} translations - Key-value pairs of the translation strings to use.\n * @param {object} [config] - Configuration options for the function.\n * @param {string} [config.locale] - An overriding locale for the PluralRules functionality.\n */\nexport function I18n (translations, config) {\n // Make list of translations available throughout function\n this.translations = translations || {}\n\n // The locale to use for PluralRules and NumberFormat\n this.locale = (config && config.locale) || document.documentElement.lang || 'en'\n}\n\n/**\n * The most used function - takes the key for a given piece of UI text and\n * returns the appropriate string.\n *\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {Object} [options] - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The appropriate translation string.\n * @throws {Error} Lookup key required\n * @throws {Error} Options required for `${}` placeholders\n */\nI18n.prototype.t = function (lookupKey, options) {\n if (!lookupKey) {\n // Print a console error if no lookup key has been provided\n throw new Error('i18n: lookup key missing')\n }\n\n // If the `count` option is set, determine which plural suffix is needed and\n // change the lookupKey to match. We check to see if it's numeric instead of\n // falsy, as this could legitimately be 0.\n if (options && typeof options.count === 'number') {\n // Get the plural suffix\n lookupKey = lookupKey + '.' + this.getPluralSuffix(lookupKey, options.count)\n }\n\n // Fetch the translation string for that lookup key\n var translationString = this.translations[lookupKey]\n\n if (typeof translationString === 'string') {\n // Check for ${} placeholders in the translation string\n if (translationString.match(/%{(.\\S+)}/)) {\n if (!options) {\n throw new Error('i18n: cannot replace placeholders in string if no option data provided')\n }\n\n return this.replacePlaceholders(translationString, options)\n } else {\n return translationString\n }\n } else {\n // If the key wasn't found in our translations object,\n // return the lookup key itself as the fallback\n return lookupKey\n }\n}\n\n/**\n * Takes a translation string with placeholders, and replaces the placeholders\n * with the provided data\n *\n * @param {string} translationString - The translation string\n * @param {Object} options - Any options passed with the translation string, e.g: for string interpolation.\n * @returns {string} The translation string to output, with ${} placeholders replaced\n */\nI18n.prototype.replacePlaceholders = function (translationString, options) {\n /** @type {Intl.NumberFormat | undefined} */\n var formatter\n\n if (this.hasIntlNumberFormatSupport()) {\n formatter = new Intl.NumberFormat(this.locale)\n }\n\n return translationString.replace(\n /%{(.\\S+)}/g,\n\n /**\n * Replace translation string placeholders\n *\n * @param {string} placeholderWithBraces - Placeholder with braces\n * @param {string} placeholderKey - Placeholder key\n * @returns {string} Placeholder value\n */\n function (placeholderWithBraces, placeholderKey) {\n if (Object.prototype.hasOwnProperty.call(options, placeholderKey)) {\n var placeholderValue = options[placeholderKey]\n\n // If a user has passed `false` as the value for the placeholder\n // treat it as though the value should not be displayed\n if (placeholderValue === false || (\n typeof placeholderValue !== 'number' &&\n typeof placeholderValue !== 'string')\n ) {\n return ''\n }\n\n // If the placeholder's value is a number, localise the number formatting\n if (typeof placeholderValue === 'number') {\n return formatter ? formatter.format(placeholderValue) : placeholderValue.toString()\n }\n\n return placeholderValue\n } else {\n throw new Error('i18n: no data found to replace ' + placeholderWithBraces + ' placeholder in string')\n }\n })\n}\n\n/**\n * Check to see if the browser supports Intl and Intl.PluralRules.\n *\n * It requires all conditions to be met in order to be supported:\n * - The browser supports the Intl class (true in IE11)\n * - The implementation of Intl supports PluralRules (NOT true in IE11)\n * - The browser/OS has plural rules for the current locale (browser dependent)\n *\n * @returns {boolean} Returns true if all conditions are met. Returns false otherwise.\n */\nI18n.prototype.hasIntlPluralRulesSupport = function () {\n return Boolean(window.Intl && ('PluralRules' in window.Intl && Intl.PluralRules.supportedLocalesOf(this.locale).length))\n}\n\n/**\n * Check to see if the browser supports Intl and Intl.NumberFormat.\n *\n * It requires all conditions to be met in order to be supported:\n * - The browser supports the Intl class (true in IE11)\n * - The implementation of Intl supports NumberFormat (also true in IE11)\n * - The browser/OS has number formatting rules for the current locale (browser dependent)\n *\n * @returns {boolean} Returns true if all conditions are met. Returns false otherwise.\n */\nI18n.prototype.hasIntlNumberFormatSupport = function () {\n return Boolean(window.Intl && ('NumberFormat' in window.Intl && Intl.NumberFormat.supportedLocalesOf(this.locale).length))\n}\n\n/**\n * Get the appropriate suffix for the plural form.\n *\n * Uses Intl.PluralRules (or our own fallback implementation) to get the\n * 'preferred' form to use for the given count.\n *\n * Checks that a translation has been provided for that plural form – if it\n * hasn't, it'll fall back to the 'other' plural form (unless that doesn't exist\n * either, in which case an error will be thrown)\n *\n * @param {string} lookupKey - The lookup key of the string to use.\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The suffix associated with the correct pluralisation for this locale.\n * @throws {Error} Plural form `.other` required when preferred plural form is missing\n */\nI18n.prototype.getPluralSuffix = function (lookupKey, count) {\n // Validate that the number is actually a number.\n //\n // Number(count) will turn anything that can't be converted to a Number type\n // into 'NaN'. isFinite filters out NaN, as it isn't a finite number.\n count = Number(count)\n if (!isFinite(count)) { return 'other' }\n\n var preferredForm\n\n // Check to verify that all the requirements for Intl.PluralRules are met.\n // If so, we can use that instead of our custom implementation. Otherwise,\n // use the hardcoded fallback.\n if (this.hasIntlPluralRulesSupport()) {\n preferredForm = new Intl.PluralRules(this.locale).select(count)\n } else {\n preferredForm = this.selectPluralFormUsingFallbackRules(count)\n }\n\n // Use the correct plural form if provided\n if (lookupKey + '.' + preferredForm in this.translations) {\n return preferredForm\n // Fall back to `other` if the plural form is missing, but log a warning\n // to the console\n } else if (lookupKey + '.other' in this.translations) {\n if (console && 'warn' in console) {\n console.warn('i18n: Missing plural form \".' + preferredForm + '\" for \"' +\n this.locale + '\" locale. Falling back to \".other\".')\n }\n\n return 'other'\n // If the required `other` plural form is missing, all we can do is error\n } else {\n throw new Error(\n 'i18n: Plural form \".other\" is required for \"' + this.locale + '\" locale'\n )\n }\n}\n\n/**\n * Get the plural form using our fallback implementation\n *\n * This is split out into a separate function to make it easier to test the\n * fallback behaviour in an environment where Intl.PluralRules exists.\n *\n * @param {number} count - Number used to determine which pluralisation to use.\n * @returns {PluralRule} The pluralisation form for count in this locale.\n */\nI18n.prototype.selectPluralFormUsingFallbackRules = function (count) {\n // Currently our custom code can only handle positive integers, so let's\n // make sure our number is one of those.\n count = Math.abs(Math.floor(count))\n\n var ruleset = this.getPluralRulesForLocale()\n\n if (ruleset) {\n return I18n.pluralRules[ruleset](count)\n }\n\n return 'other'\n}\n\n/**\n * Work out which pluralisation rules to use for the current locale\n *\n * The locale may include a regional indicator (such as en-GB), but we don't\n * usually care about this part, as pluralisation rules are usually the same\n * regardless of region. There are exceptions, however, (e.g. Portuguese) so\n * this searches by both the full and shortened locale codes, just to be sure.\n *\n * @returns {string | undefined} The name of the pluralisation rule to use (a key for one\n * of the functions in this.pluralRules)\n */\nI18n.prototype.getPluralRulesForLocale = function () {\n var locale = this.locale\n var localeShort = locale.split('-')[0]\n\n // Look through the plural rules map to find which `pluralRule` is\n // appropriate for our current `locale`.\n for (var pluralRule in I18n.pluralRulesMap) {\n if (Object.prototype.hasOwnProperty.call(I18n.pluralRulesMap, pluralRule)) {\n var languages = I18n.pluralRulesMap[pluralRule]\n for (var i = 0; i < languages.length; i++) {\n if (languages[i] === locale || languages[i] === localeShort) {\n return pluralRule\n }\n }\n }\n }\n}\n\n/**\n * Map of plural rules to languages where those rules apply.\n *\n * Note: These groups are named for the most dominant or recognisable language\n * that uses each system. The groupings do not imply that the languages are\n * related to one another. Many languages have evolved the same systems\n * independently of one another.\n *\n * Code to support more languages can be found in the i18n spike:\n * {@link https://github.com/alphagov/govuk-frontend/blob/spike-i18n-support/src/govuk/i18n.mjs}\n *\n * Languages currently supported:\n *\n * Arabic: Arabic (ar)\n * Chinese: Burmese (my), Chinese (zh), Indonesian (id), Japanese (ja),\n * Javanese (jv), Korean (ko), Malay (ms), Thai (th), Vietnamese (vi)\n * French: Armenian (hy), Bangla (bn), French (fr), Gujarati (gu), Hindi (hi),\n * Persian Farsi (fa), Punjabi (pa), Zulu (zu)\n * German: Afrikaans (af), Albanian (sq), Azerbaijani (az), Basque (eu),\n * Bulgarian (bg), Catalan (ca), Danish (da), Dutch (nl), English (en),\n * Estonian (et), Finnish (fi), Georgian (ka), German (de), Greek (el),\n * Hungarian (hu), Luxembourgish (lb), Norwegian (no), Somali (so),\n * Swahili (sw), Swedish (sv), Tamil (ta), Telugu (te), Turkish (tr),\n * Urdu (ur)\n * Irish: Irish Gaelic (ga)\n * Russian: Russian (ru), Ukrainian (uk)\n * Scottish: Scottish Gaelic (gd)\n * Spanish: European Portuguese (pt-PT), Italian (it), Spanish (es)\n * Welsh: Welsh (cy)\n *\n * @type {Object}\n */\nI18n.pluralRulesMap = {\n arabic: ['ar'],\n chinese: ['my', 'zh', 'id', 'ja', 'jv', 'ko', 'ms', 'th', 'vi'],\n french: ['hy', 'bn', 'fr', 'gu', 'hi', 'fa', 'pa', 'zu'],\n german: [\n 'af', 'sq', 'az', 'eu', 'bg', 'ca', 'da', 'nl', 'en', 'et', 'fi', 'ka',\n 'de', 'el', 'hu', 'lb', 'no', 'so', 'sw', 'sv', 'ta', 'te', 'tr', 'ur'\n ],\n irish: ['ga'],\n russian: ['ru', 'uk'],\n scottish: ['gd'],\n spanish: ['pt-PT', 'it', 'es'],\n welsh: ['cy']\n}\n\n/**\n * Different pluralisation rule sets\n *\n * Returns the appropriate suffix for the plural form associated with `n`.\n * Possible suffixes: 'zero', 'one', 'two', 'few', 'many', 'other' (the actual\n * meaning of each differs per locale). 'other' should always exist, even in\n * languages without plurals, such as Chinese.\n * {@link https://cldr.unicode.org/index/cldr-spec/plural-rules}\n *\n * The count must be a positive integer. Negative numbers and decimals aren't accounted for\n *\n * @type {Object}\n */\nI18n.pluralRules = {\n /* eslint-disable jsdoc/require-jsdoc */\n arabic: function (n) {\n if (n === 0) { return 'zero' }\n if (n === 1) { return 'one' }\n if (n === 2) { return 'two' }\n if (n % 100 >= 3 && n % 100 <= 10) { return 'few' }\n if (n % 100 >= 11 && n % 100 <= 99) { return 'many' }\n return 'other'\n },\n chinese: function () {\n return 'other'\n },\n french: function (n) {\n return n === 0 || n === 1 ? 'one' : 'other'\n },\n german: function (n) {\n return n === 1 ? 'one' : 'other'\n },\n irish: function (n) {\n if (n === 1) { return 'one' }\n if (n === 2) { return 'two' }\n if (n >= 3 && n <= 6) { return 'few' }\n if (n >= 7 && n <= 10) { return 'many' }\n return 'other'\n },\n russian: function (n) {\n var lastTwo = n % 100\n var last = lastTwo % 10\n if (last === 1 && lastTwo !== 11) { return 'one' }\n if (last >= 2 && last <= 4 && !(lastTwo >= 12 && lastTwo <= 14)) { return 'few' }\n if (last === 0 || (last >= 5 && last <= 9) || (lastTwo >= 11 && lastTwo <= 14)) { return 'many' }\n // Note: The 'other' suffix is only used by decimal numbers in Russian.\n // We don't anticipate it being used, but it's here for consistency.\n return 'other'\n },\n scottish: function (n) {\n if (n === 1 || n === 11) { return 'one' }\n if (n === 2 || n === 12) { return 'two' }\n if ((n >= 3 && n <= 10) || (n >= 13 && n <= 19)) { return 'few' }\n return 'other'\n },\n spanish: function (n) {\n if (n === 1) { return 'one' }\n if (n % 1000000 === 0 && n !== 0) { return 'many' }\n return 'other'\n },\n welsh: function (n) {\n if (n === 0) { return 'zero' }\n if (n === 1) { return 'one' }\n if (n === 2) { return 'two' }\n if (n === 3) { return 'few' }\n if (n === 6) { return 'many' }\n return 'other'\n }\n /* eslint-enable jsdoc/require-jsdoc */\n}\n\n/**\n * Plural rule category mnemonic tags\n *\n * @typedef {'zero' | 'one' | 'two' | 'few' | 'many' | 'other'} PluralRule\n */\n\n/**\n * Translated message by plural rule they correspond to.\n *\n * Allows to group pluralised messages under a single key when passing\n * translations to a component's constructor\n *\n * @typedef {object} TranslationPluralForms\n * @property {string} [other] - General plural form\n * @property {string} [zero] - Plural form used with 0\n * @property {string} [one] - Plural form used with 1\n * @property {string} [two] - Plural form used with 2\n * @property {string} [few] - Plural form used for a few\n * @property {string} [many] - Plural form used for many\n */\n"],"names":[],"mappings":";;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AACA,EAAO,SAAS,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE;EAC5C;EACA,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