diff --git a/pix-pro/i18n.config.ts b/pix-pro/i18n.config.ts index fbb6f3441..c8da7e0d1 100644 --- a/pix-pro/i18n.config.ts +++ b/pix-pro/i18n.config.ts @@ -2,9 +2,11 @@ import { generateConfig } from '../shared/i18n.config'; const reachableLocales = [ { + // The "code" property should be renamed into "name": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/Locale code: 'en', iso: 'en', file: 'en.js', + // The "name" property should be renamed into "displayName": https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/DisplayNames name: 'English', icon: 'globe-europe.svg', domain: process.env.DOMAIN_ORG, @@ -27,6 +29,8 @@ const reachableLocales = [ }, ]; +const reachableLocaleNames = reachableLocales.map(reachableLocale => reachableLocale.code); + const config = generateConfig(reachableLocales); export default { ...config }; -export { reachableLocales }; +export { reachableLocales, reachableLocaleNames }; diff --git a/pix-pro/nuxt.config.ts b/pix-pro/nuxt.config.ts index 56f0fdbec..3328af4f6 100644 --- a/pix-pro/nuxt.config.ts +++ b/pix-pro/nuxt.config.ts @@ -1,5 +1,5 @@ import { getRoutesToGenerate } from './services/get-routes-to-generate'; -import i18nConfig, { reachableLocales } from './i18n.config'; +import i18nConfig, { reachableLocales, reachableLocaleNames } from './i18n.config'; export default async () => { return defineNuxtConfig({ @@ -28,6 +28,7 @@ export default async () => { public: { site: 'https://pro.pix.', availableLocales: reachableLocales, + availableLocaleNames: reachableLocaleNames, }, }, nitro: {