Write fixi-family attributes in your own language — fx-action → fx-acción / fx-アクション, live, on-click, fx-ignore and friends — across 24 locales, resolved at processing time.
Names resolve at processing time through small per-library hooks — no preprocessor, no DOM mutation, and the attribute you wrote is the attribute devtools shows.
<!DOCTYPE html>
<html lang="es">
<head>
<script src="./loka.js"></script> <!-- defines window.loka, installs the localization hooks -->
<script src="./locales/es.js"></script> <!-- registers Spanish vocabulary -->
<script src="./fixi.js"></script> <!-- the fixi library, now localization-aware -->
</head>
<body>
<button fx-acción="/api" fx-disparador="clic" fx-objetivo="#out">Cargar</button>
<div id="out"></div>
</body>
</html>
Three things to notice:
fx-acción.fx-acción — the attribute is never rewritten.#out correctly.Pick your locale; the snippets below update in place. One tag installs the libraries plus the chosen locale via jsDelivr's /combine/ feature, which preserves load order automatically.
All five libraries:
Minimal (fixi only). Drop the libraries you don't need from the URL; keep loka.js first, the locale second, and fixi.js last:
Load order matters: loka.js must define window.loka.register before the locale registers vocabulary, and each library reads the registry at script-load time via ??= defaults. URL order in /combine/ preserves source order in the concatenated response, so the constraint is satisfied for you — but if you load the files individually, keep loka.js first and fixi.js last (with moxi.js before fixi.js, per fixiproject convention).
With no locale module loaded, every patched library is behaviorally identical to upstream — verified by a behavior-preservation harness.
English is canonical fixi and needs no vocabulary module; the other 23 each ship one.
Attribute names are a judgment call in every language, and corrections from
speakers are the most useful contribution here — open an
issue or send a PR against
scripts/fx-vocab.mjs.
This page declares <html lang="en">, but each section below sets its own lang. Every section's fixi attributes resolve against its own language — Spanish in the Spanish section, Japanese in the Japanese section, English at the top level. Click the buttons; each loads a fragment through its localized fx-* attributes.
Open full demos in a new tab: per-element language · all five libraries on one Spanish page
fx-acción, al-clic, fx-intercambio="morfar" stay verbatim in the DOM. Devtools shows exactly what you authored — the libraries resolve the canonical name through hooks at read time, not by mutating your markup.
Language is resolved via the nearest lang ancestor, so one page can mix <section lang="es"> and <section lang="ja"> and each resolves its own vocabulary. A preprocessor would have to commit to one language up front.
loka ships lightly-patched copies (~30–150 bytes each) that are bit-identical to upstream when no locale is loaded. The patches do nothing until a locale registers, so they re-port cleanly against upstream changes.
loka-js and LokaScript draw their event and action words from the same @lokascript/semantic vocabulary source. A "click" is clic in both worlds, so a Spanish-speaking developer moving between rich hyperscript-style behaviors and minimal fixi-family hypermedia doesn't relearn DOM-event names.
The multilingual layer for hyperscript — write rich behaviors like al hacer clic alternar .active en mi in 24 languages. Reach for it when you're writing client-side behavior.
The same idea applied to the fixi family — write minimal hypermedia attributes (fx-acción, fx-objetivo, …) in those same 24 languages. Reach for it when you're writing HTTP-attribute hypermedia. The two compose on one page without conflict.
0BSD-licensed. 24 locales. Corrections to any language's attribute names are welcome.