Skip to content

Commit

Permalink
Do not display language without locales
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Mar 3, 2025
1 parent 427b220 commit 7638e90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/services/getConfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export const getTemplates = (file, languages) => {

const headersConfig = getConfig('header.json', true);

const { supportedLanguages } = headersConfig.menu;
const locales = getLocales(headersConfig.menu.supportedLanguages);

const supportedLanguages = Object.entries(locales)
.filter(([, value]) => Object.keys(value).length)
.map(([languageCode]) => languageCode);

const detailsConfig = getConfig('details.json', true, true);

Expand Down Expand Up @@ -111,7 +115,7 @@ export const runtimeConfig = {
style: getConfig('../theme/style.css', false),
colors: getConfig('../theme/colors.json', true),
details,
header: headersConfig,
header: { ...headersConfig, menu: { ...headersConfig.menu, supportedLanguages } },
global: getConfig('global.json', true),
home: getConfig('home.json', true),
map: getConfig('map.json', true),
Expand Down

0 comments on commit 7638e90

Please sign in to comment.