Skip to content

Commit

Permalink
Code fixes for I18n, Accordion, Character count
Browse files Browse the repository at this point in the history
As identified by the `tsc` TypeScript compiler
  • Loading branch information
colinrotherham committed Nov 10, 2022
1 parent f60b999 commit adcc8a2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/govuk/components/accordion/accordion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ var TRANSLATIONS_DEFAULT = {
function Accordion ($module, config) {
this.$module = $module
this.$sections = $module.querySelectorAll('.govuk-accordion__section')
this.$showAllButton = ''
this.browserSupportsSessionStorage = helper.checkForSessionStorage()

var defaultConfig = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ describe('Character count', () => {

await renderAndInitialise(page, 'character-count', {
nunjucksParams: examples.default,
config: {
javascriptConfig: {
// Override maxlength to 10
maxlength: 10
},
Expand Down
4 changes: 1 addition & 3 deletions src/govuk/i18n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@
* @param {string} config.locale - An overriding locale for the PluralRules functionality.
*/
export function I18n (translations, config) {
config = config || {}

// Make list of translations available throughout function
this.translations = translations || {}

// The locale to use for PluralRules and NumberFormat
this.locale = config.locale || document.documentElement.lang || 'en'
this.locale = (config && config.locale) || document.documentElement.lang || 'en'
}

/**
Expand Down

0 comments on commit adcc8a2

Please sign in to comment.