Skip to content

Commit 405710d

Browse files
Fix compiler “Property 'locale' is missing in type '{}'”
1 parent 3265af4 commit 405710d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/govuk/i18n.mjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
* @param {string} config.locale - An overriding locale for the PluralRules functionality.
1010
*/
1111
export function I18n (translations, config) {
12-
config = config || {}
13-
1412
// Make list of translations available throughout function
1513
this.translations = translations || {}
1614

1715
// The locale to use for PluralRules and NumberFormat
18-
this.locale = config.locale || document.documentElement.lang || 'en'
16+
this.locale = (config && config.locale) || document.documentElement.lang || 'en'
1917
}
2018

2119
/**

0 commit comments

Comments
 (0)