Skip to content

Commit

Permalink
move Version
Browse files Browse the repository at this point in the history
  • Loading branch information
cheungaryk committed Sep 18, 2024
1 parent 1350ef9 commit bb77309
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/js/21-coveo-facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'use strict'

const searchProducts = MSCX.l10n.getMessage('search-results-filter-placeholder-text')
const version = MSCX.l10n.getMessage('version')
const atomicFacetsLayoutSection = document.querySelector('atomic-layout-section[section="facets"]')
if (!atomicFacetsLayoutSection) return

Expand All @@ -26,8 +27,7 @@
versionFacet.setAttribute('facet-id', `${componentID}-version`)
versionFacet.setAttribute('field', 'mulesoftversionwithlatest')
versionFacet.setAttribute('heading-level', 2)
const label = isJapaneseSite() ? 'バージョン' : 'Version'
versionFacet.setAttribute('label', `${componentDisplayName} ${label}`)
versionFacet.setAttribute('label', `${componentDisplayName} ${version}`)
versionFacet.setAttribute('number-of-value', 20)
versionFacet.setAttribute('sort-criteria', 'score')
versionFacet.setAttribute('with-search', false)
Expand All @@ -46,7 +46,6 @@
}
}

const isJapaneseSite = () => document.documentElement.lang === 'jp'
const isNumberedVersion = (versionName) => !['default', 'latest', 'master'].includes(versionName)
const isSearchable = (componentName) => !['general, reuse'].includes(componentName)

Expand Down
6 changes: 4 additions & 2 deletions src/locales/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"right-nav-skip-to-sections": "Skip to page content sections",
"search-close-button": "Close",
"search-results-filter-placeholder-text": "Search Products",
"search-toolbar-button": "Search Docs"
"search-toolbar-button": "Search Docs",
"version": "Version"
},
"jp": {
"breadcrumbs-home": "ホームページ",
Expand All @@ -53,6 +54,7 @@
"right-nav-on-this-page": "このページの内容:",
"search-close-button": "閉じる",
"search-results-filter-placeholder-text": "製品を検索",
"search-toolbar-button": "ドキュメントの検索"
"search-toolbar-button": "ドキュメントの検索",
"version": "バージョン"
}
}

0 comments on commit bb77309

Please sign in to comment.