Widget

Languages

Eight built-in locales, lazy-loaded, with sensible fallbacks.

The widget ships with 8 built-in locales: English (en), Korean (ko, the default), French (fr), German (de), Spanish (es), Italian (it), Brazilian Portuguese (pt), and Russian (ru).

initInstaFix({
  endpoint: "/api/instafix",
  projectName: "my-project",
  locale: "fr",
});

How resolution works

  • English and Korean (the default) are bundled; every other locale loads as its own tiny chunk, so you only download the language you use.
  • Full BCP-47 tags are welcome — "fr-CA" resolves to fr, "pt-BR" to pt.
  • An unknown locale logs a console.warn and falls back to English. Nothing breaks.
  • While a locale chunk is loading, labels render in English and re-localize the moment it lands; markers wait for the translations so screen-reader labels are never half-translated.

Custom locales

registerLocale(code, translations) adds a language the widget doesn't ship, and loadLocale(code) fetches a built-in dictionary ahead of time. Both are runtime exports of @instafix/widget:

import { initInstaFix, registerLocale, type Translations } from "@instafix/widget";

registerLocale("nl", { "panel.title": "Feedbacks", "fab.annotate": "Nieuwe annotatie maken" });
initInstaFix({ endpoint: "/api/instafix", projectName: "my-project", locale: "nl" });

Partial dictionaries are fine. Missing keys fall back to English key by key, so overriding a single string never means copying the whole catalog — pass the Translations type only if you want the full set checked. Two rules the implementation enforces: register under the base language code ("nl", not "nl-BE" — lookups normalize to the base), and call registerLocale before initInstaFix.

await loadLocale("fr") before init if you want a built-in locale on screen from the first paint instead of a brief English flash.

The dashboard follows the same set

@instafix/dashboard ships the same eight locales with the same resolution rules, and exports its own registerLocale with the same partial-dictionary behavior — see the dashboard docs.

Want your language built in? Locale contributions are the friendliest first PR to this project — see CONTRIBUTING ("Adding a Locale").

Edit on GitHub

On this page