Skip to content

Commit

Permalink
feat(pix-pro): add runtimeConfig.public.availableLocaleCodes
Browse files Browse the repository at this point in the history
  • Loading branch information
lego-technix committed Oct 2, 2024
1 parent 40fc29e commit f09455c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pix-pro/i18n.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 };
3 changes: 2 additions & 1 deletion pix-pro/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -28,6 +28,7 @@ export default async () => {
public: {
site: 'https://pro.pix.',
availableLocales: reachableLocales,
availableLocaleNames: reachableLocaleNames,
},
},
nitro: {
Expand Down

0 comments on commit f09455c

Please sign in to comment.