We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3265af4 commit 405710dCopy full SHA for 405710d
src/govuk/i18n.mjs
@@ -9,13 +9,11 @@
9
* @param {string} config.locale - An overriding locale for the PluralRules functionality.
10
*/
11
export function I18n (translations, config) {
12
- config = config || {}
13
-
14
// Make list of translations available throughout function
15
this.translations = translations || {}
16
17
// The locale to use for PluralRules and NumberFormat
18
- this.locale = config.locale || document.documentElement.lang || 'en'
+ this.locale = (config && config.locale) || document.documentElement.lang || 'en'
19
}
20
21
/**
0 commit comments