-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Expand file tree
/
Copy pathnext.locales.mjs
More file actions
36 lines (29 loc) · 1.07 KB
/
next.locales.mjs
File metadata and controls
36 lines (29 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
import {
getAvailableLocales,
getAvailableLocaleCodes,
getDefaultLocale,
getAvailableLocalesMap,
getAllLocaleCodes,
} from '@node-core/website-i18n';
// As set of available and enabled locales for the website
// This is used for allowing us to redirect the user to any
// of the available locales that we have enabled on the website
const availableLocales = getAvailableLocales();
// This gives an easy way of accessing all available locale codes
const availableLocaleCodes = getAvailableLocaleCodes();
// This provides the default locale information for the Next.js Application
// This is marked by the unique `locale.default` property on the `en` locale
/** @type {import('@node-core/website-i18n/types').LocaleConfig} */
const defaultLocale = getDefaultLocale();
// Creates a Map of available locales for easy access
const availableLocalesMap = getAvailableLocalesMap();
// Creates all supported locales
const allLocaleCodes = getAllLocaleCodes();
export {
allLocaleCodes,
availableLocales,
availableLocaleCodes,
availableLocalesMap,
defaultLocale,
};