Translations
The Translations page manages every user-facing string emitted by Haus Storefront widgets. Defaults are seeded from the plugin's English source, additional languages can be added on top, and saved translations are published as JSON files that the storefront loads at runtime through i18next.
Go to WordPress Admin > Haus Storefront > Translations.
What You Can Do
- Add and remove supported storefront languages.
- Edit translated values per key for each language.
- Search across keys, namespaces, and existing values.
- Insert dynamic placeholders such as
{{productName}}where the source string supports them. - Publish new translation JSON files and bump the storefront i18n version on save.
UI Workflow
- Open Manage available languages and add the language codes you need.
- Use the search box to locate a key by namespace, key path, or any existing value.
- Enter or paste a translation in the per-language column. Empty cells use the English default.
- For dynamic strings, use the placeholder picker to insert tokens such as
{{productName}}. - Click Save — the plugin validates entries, persists the option, regenerates the published JSON files, and bumps the i18n version.
Locale Resolution
Widgets resolve the active language as follows:
- Use the explicit
localeprop passed to the widget if non-empty. - Otherwise, read
document.documentElement.langand take the first segment (e.g.sv-SE->sv). - Fall back to
en.
Set <html lang="..."> correctly on the page (typically via your WordPress translation plugin or theme) to drive widget locale.
Published Files
Saving regenerates files under wp-content/uploads/haus-i18n/:
haus-i18n/{lang}/{namespace}.json— per-namespace JSON.haus-i18n/{lang}/translation.json— merged file consumed by the runtimeloadPath.
Cache-bust by checking the ?v= parameter on the storefront's load URL after saving.
Reverting Translations (CLI)
To wipe translation state and let migrations re-run from scratch on the next admin load:
wp haus-storefront revert-translations