20 lines
940 B
JavaScript
20 lines
940 B
JavaScript
/**
|
|
* The locale codes, as plain JavaScript.
|
|
*
|
|
* `config.ts` is the real table and everything the site renders reads from it. This
|
|
* exists because two things run before TypeScript does: `astro.config.mjs`, which needs
|
|
* the codes to build the i18n config, and the build-time checker. Keeping it to the
|
|
* bare codes means the duplication is two short arrays that cannot drift far, and
|
|
* `scripts/check-i18n.mjs` compares the two on every build so they cannot drift at all.
|
|
*
|
|
* Adding a language: the code here, the full entry in `config.ts`, and the import and
|
|
* `CATALOGS` line in `index.ts`. The last one is the one that gets forgotten, and the
|
|
* only symptom is the new language rendering in English.
|
|
*/
|
|
export const DEFAULT_LOCALE = 'en';
|
|
|
|
export const LOCALE_CODES = [
|
|
'en', 'es', 'nl', 'zh', 'hi', 'ar', 'fr', 'pt', 'it', 'tr', 'pl', 'uk', 'ro', 'el', 'cs',
|
|
'sv', 'da', 'id', 'ur', 'ru', 'de', 'ja', 'ar-eg', 'vi',
|
|
];
|