Repository navigation
v0.5.0
Minor Changes
-
4050d36:
lazy: "locale"splits dictionaries per locale, so a visitor only downloads the language they read.dx generatewrites one module per dictionary and locale into adialex.locales/folder next todialex.generated.ts, andloaderspoints at them. In a real Vite build the main bundle holds neither language, and a Turkish page fetched only the.trchunks until the visitor switched to English, which then fetched the.enones.- Switching language downloads the new locale on demand. In React the current language stays on screen until the new one has arrived (the update runs in a transition); in Vue the dictionary is empty until it loads, and server-side rendering waits for it.
preloadDictionaries(dialex, { locale: "tr" }, "pricing")fetches a locale ahead of time.- A dictionary is split only when each locale is self-contained. If a locale uses something defined elsewhere in its file (an import or a helper), the dictionary is loaded whole and
dx generatesays why. dx checkreports missing or out-of-date per-locale modules, and--fixrewrites them.lazy: trueis unchanged.dx generateno longer treats its own output (dialex.generated.ts,*.d.ts) as dictionaries whenincludeis broad, such assrc/**/*.ts.
-
b39c7f6: Stale translations are detected.
dx translatenow writesdialex.lock.json, which records a short hash of the source text behind each translation, so a later edit of the source no longer leaves the other languages silently out of date.dx checkwarns about each translation whose source text changed since it was recorded (stale-translation), and--fail-on-stalemakes it an error. The VS Code extension shows the same warning. Translations without a record (hand-written ones) are never reported.dx translate --staletranslates the out-of-date strings again; only these may replace an existing translation.dx lockrecords the translations you already have, so existing projects can adopt the lock file (--allalso accepts out-of-date ones).dx importrecords what it imports once a lock file exists.- MCP:
dialex_missingalso listsstaletranslations.
-
5235a9f:
t()checks ICU arguments.dx generatewritesMessageArgumentsintodialex-env.d.ts(read from each dictionary's default locale), sot("cart.items", { count })fails to compile whencountis missing, misspelled or not a number.plural,selectordinalandnumberarenumber,dateandtimeareDate | number,selectis the union of its options, and a plain{name}takes a string, number, boolean orDate.A message that has ICU arguments can no longer be called without values (
t("cart.owner")was allowed and returned the raw string). Pass the values, or remove the braces if they were literal.Adapters that scan the project at runtime (no
dictionariespassed) no longer writedialex-env.d.ts; it was a second writer that could undo the generated file. Rundx generate.