Tweakwise fully supports multi-language shops. With the tn_lang parameter you control in which language the API returns data. This affects how facets, attribute values and other labels are shown, but also the behaviour of search, autocomplete, and suggestions. It helps you give every customer the right experience in their own language.
If your shop runs in multiple languages, using tn_lang is essential.
How it works
1. Configure your languages in the Tweakwise app
Go to Settings → Languages in the Tweakwise app.
Here you define the languages used on your shop:
- Display language: control the language of facet titles, attribute values, and other UI labels in the API response.
- Algorithm language: determine how queries are interpreted (pluralisation, stemming, splitting, synonyms, etc.).
Each language has a language code. This code is exactly what you send as the value of tn_lang.
2. Pass tn_lang in every request
tn_lang in every requestAdd the language code you configured in the app to every relevant endpoint:
Tweakwise will then:
- Use the display language to translate facets, attributes, and labels.
- Apply the corresponding search language to interpret the user's query.
3. Render the translated API response
Facet titles, attribute names, and UI labels are already translated in the response.
Just display them in your frontend.
Notes
-
If you don’t send
tn_lang, Tweakwise uses the language configured as default. -
Only languages enabled in your Tweakwise instance can be used.
-
If translations seem missing or falling back to default, check if the language is fully configured in the Tweakwise app.
-
To programattically check which languages are available for a specific Tweakwise instance, use the catalog/languages endpoint.
-
In Magento, go to Stores > Configuration > Catalog > Tweakwise. In the General section, configure the language:
Frequently Asked Questions
- What happens if I use a language that isn’t enabled?
Tweakwise falls back to the default language. You won’t get an error, but translations won’t match what you expect. - Do I need to add tn_lang to every request?
Yes. Every endpoint that returns user-facing content (search, facets, suggestions, autocomplete) should have the same language parameter to avoid mixed-language responses. - Why are my facets not translated even though I passed tn_lang?
Most common causes:- The facet title/attribute value isn’t translated in the Backoffice.
- The wrong language code is used (e.g. eng instead of en).
- The facet uses custom labels that weren’t localised.
