/wings-authoring:wings-i18nfrom WINGS Authoring
Adds i18n to WINGS apps: auto-detect browser language, extract translatable text via build step, runtime catalog lookup, plurals/gender flexion, locale-aware number/currency/date formatting, and runtime language switching.
Ships in WINGS Authoring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The model: author natural text in templates. A build step (gen_i18n)
rewrites templates, replacing each translatable string with a stable numeric
index and emitting a per-language JSON catalog. At runtime the wi18n package
loads the catalog and swaps each index back to the translated string. You never
write index numbers by hand.
_ "github.com/luisfurquim/wings/wi18n" in main.go.
It auto-detects the browser language, loads i18n/<lang>.json, and makes
wings.Main() wait for the catalog before rendering.go run github.com/luisfurquim/wings/cmd/build@latest dev with i18n options,
or the repo's gen_i18n); it produces *.i18n.html + i18n/<deflang>.json.i18n/<lang>.json (one per language) in your web root.<h2>Dashboard</h2> → extracted.title, placeholder, alt, aria-label,
data-i18n, plus label/helper/error (the w-input text attributes)
(wings.TranslatableAttrs). Other attribute text is left alone.{{expression}} output passes through untranslated — so
translate the template literals, not the data. If you need a data value
localized, format it (see formatting below) or translate it in your data.Opt a subtree out with the standard HTML translate="no" (inherited by
children) — useful for code samples, proper nouns, or literal index demos.
For CSS-generated text use data-i18n="..." + content: attr(data-i18n) so it
flows through the same pipeline (don't hardcode user-visible text in CSS).
A single translated string can't express a target language's plural/gender
agreement. Use inline flex sigils inside a {{...}} block (see the syntax
table in wings-component):
@var — gender axis (the value selects a gender row).%var — count axis (emitted at its position; drives the CLDR plural category).~word — a stem the translator will inflect.#N — a rule index auto-assigned by gen_i18n; never write it yourself.<p>{{@gender %qt ~aluno ~aprovado}}</p>
gen_i18n rewrites this to a #N rule and emits an i18n/<lang>.inflections.json
(gender × CLDR-category cells) for translators. For programmable inflection
engines see README "Programmable Flex (CustomFlex)".
A lone {{%var}} (no ~/@) formats a value for the locale — type-directed:
ints/floats, time.Time, wi18n.Currency, or any type implementing
wi18n.Numerical. Named formats: {{%var:formatName}} keyed by <lang>.fmt.json.
<span>{{%price}}</span> <!-- formatted "R$ 1.234,50" / "$1,234.50" by locale -->
wi18n.Currency is money as an integer in the currency's minor unit (avoids
float rounding), not a float:
type Currency struct {
Amount int64 // minor units: centavos/cents (123450 == 1234.50)
Code string // ISO 4217, e.g. "BRL", "USD", "JPY"
}
// e.g. "price": wi18n.Currency{Amount: 123450, Code: "BRL"}
Physical units (length, temperature, speed, …) have their own measure packages; see README "Physical Measure Packages".
Switch language live with wi18n.SetLang:
wi18n.SetLang("es-AR", func(err error) {
if err != nil { /* handle: revert UI, show dialog */ }
})
go wi18n.SetLang(...)) — calling it
synchronously from an event handler that the runtime is also driving can
deadlock.wi18n.SetCatalogPublicKey, ed25519), a tampered/unsigned catalog yields a
typed *wi18n.CatalogSignatureError (errors.As) — the bundle is refused
(fail-closed). A language-switcher component should branch on it: revert the
<select> to the current locale and surface the error (e.g. open a w-dialog).wi18n.Lang() returns the active tag.content in a catalog renders the raw index — a deliberate
missing-translation signal.helpers/wlate GUI.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
11 skills in this plugin
/sec-fail-operationalApollo AGC fail-operational design (priority shedding, bounded everything, restart protection, NASA Power of 10) applied to YOUR WINGS app — loops, goroutines, timers, fetch error paths, recovery. Use when writing component effects, background goroutines, polling/retry, or any code that must keep the app rendering when one part fails./sec-fuzzingContinuous fuzzing with Go native fuzzing for any parser/decoder YOU add to a WINGS app — keeping parseable logic in portable (non-js) packages so it's fuzzable, writing targets, the properties to assert, corpus management. Use when you add or change any string/byte parser, custom wire format, or decoder in your app./sec-hostile-inputInput validation and parsing discipline for WINGS apps (djb "don't parse" + Margaret Hamilton's defensive design) — applied to YOUR boundaries — fetch/API responses, form fields, URL hash/query, postMessage, localStorage, and js.Values. Use when writing or changing any code in your app that reads data from outside the wasm module./sec-minimal-trusted-codedjb's trusted-code minimization applied to YOUR WINGS app — keep parsing at build time, design misuse-resistant APIs, add the fewest deps and config knobs, don't evaluate user strings at runtime. Use when designing a new component/package/public helper, adding a dependency or config option, or reviewing a diff that grows your app./sec-supply-chainDependency and artifact integrity for YOUR WINGS app — adding/updating Go modules, pinning the wings version, govulncheck (native + GOOS=js passes), SRI on served scripts, signing the catalogs you ship, Docker FROM wings, never baking secrets into images. Use whenever your go.mod/go.sum changes, you prepare a release, or you serve/fetch an artifact./sec-wasm-goSecurity peculiarities of Go-to-WASM in the browser, for apps you build with WINGS — the syscall/js trust boundary, panic = whole-app death, the innerHTML/XSS invariant, secrets in browser memory, single-thread concurrency, GOOS=js tooling gaps. Use when writing or reviewing any component (GOOS=js code), DOM interop via syscall/js, fetch, or browser-delivered features in your app.npx claudepluginhub luisfurquim/wings --plugin wings-authoringOther plugins' skills for the same job