Wire locale catalogs, repair mint terminology, and confirm login with a toast.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+48
-1
@@ -2,14 +2,40 @@
|
||||
* Build-time i18n entry point. Imported from .astro frontmatter, never from an island.
|
||||
*
|
||||
* Every catalog is imported statically here, which is exactly what we want at build
|
||||
* time (one process renders all three locales) and exactly what we do not want in the
|
||||
* time (one process renders every locale) and exactly what we do not want in the
|
||||
* browser. Islands import `./client` instead, which reads the one locale the page
|
||||
* already carries. Nothing in this file reaches a bundle: Astro frontmatter runs on the
|
||||
* build machine only.
|
||||
*
|
||||
* Every locale in `LOCALES` needs a line in both places below. A locale listed in the
|
||||
* table with no catalog here does not fail: it silently renders English under its own
|
||||
* `lang` and URL prefix, which is worse than failing. `test/i18n-wiring.test.mjs`
|
||||
* fails instead.
|
||||
*/
|
||||
import en from './en.json';
|
||||
import es from './es.json';
|
||||
import nl from './nl.json';
|
||||
import zh from './zh.json';
|
||||
import hi from './hi.json';
|
||||
import ar from './ar.json';
|
||||
import fr from './fr.json';
|
||||
import pt from './pt.json';
|
||||
import it from './it.json';
|
||||
import tr from './tr.json';
|
||||
import pl from './pl.json';
|
||||
import uk from './uk.json';
|
||||
import ro from './ro.json';
|
||||
import el from './el.json';
|
||||
import cs from './cs.json';
|
||||
import sv from './sv.json';
|
||||
import da from './da.json';
|
||||
import id from './id.json';
|
||||
import ur from './ur.json';
|
||||
import ru from './ru.json';
|
||||
import de from './de.json';
|
||||
import ja from './ja.json';
|
||||
import areg from './ar-eg.json';
|
||||
import vi from './vi.json';
|
||||
|
||||
import { CLIENT_NAMESPACES, DEFAULT_LOCALE, LOCALE_CODES, isLocale, type Locale } from './config.js';
|
||||
import { createTranslator, type Catalog, type Translator } from './translate.js';
|
||||
@@ -22,6 +48,27 @@ const CATALOGS: Record<string, Catalog> = {
|
||||
en: en as Catalog,
|
||||
es: es as Catalog,
|
||||
nl: nl as Catalog,
|
||||
zh: zh as Catalog,
|
||||
hi: hi as Catalog,
|
||||
ar: ar as Catalog,
|
||||
fr: fr as Catalog,
|
||||
pt: pt as Catalog,
|
||||
it: it as Catalog,
|
||||
tr: tr as Catalog,
|
||||
pl: pl as Catalog,
|
||||
uk: uk as Catalog,
|
||||
ro: ro as Catalog,
|
||||
el: el as Catalog,
|
||||
cs: cs as Catalog,
|
||||
sv: sv as Catalog,
|
||||
da: da as Catalog,
|
||||
id: id as Catalog,
|
||||
ur: ur as Catalog,
|
||||
ru: ru as Catalog,
|
||||
de: de as Catalog,
|
||||
ja: ja as Catalog,
|
||||
'ar-eg': areg as Catalog,
|
||||
vi: vi as Catalog,
|
||||
};
|
||||
|
||||
/** The English catalog, which is what every other locale falls back to key by key. */
|
||||
|
||||
Reference in New Issue
Block a user