diff --git a/src/js/21-coveo-facets.js b/src/js/21-coveo-facets.js index ddbba6082..110675a22 100644 --- a/src/js/21-coveo-facets.js +++ b/src/js/21-coveo-facets.js @@ -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 @@ -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) @@ -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) diff --git a/src/locales/messages.json b/src/locales/messages.json index f24c4b909..482aae0ac 100644 --- a/src/locales/messages.json +++ b/src/locales/messages.json @@ -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": "ホームページ", @@ -53,6 +54,7 @@ "right-nav-on-this-page": "このページの内容:", "search-close-button": "閉じる", "search-results-filter-placeholder-text": "製品を検索", - "search-toolbar-button": "ドキュメントの検索" + "search-toolbar-button": "ドキュメントの検索", + "version": "バージョン" } } \ No newline at end of file