Localize your perks
Show your perks experience in your customer's language, so a Spanish- or French-speaking customer sees the buttons, labels, and perk copy translated instead of English.
Paylode keeps English as the source language and maintains Spanish (ES)
and French (FR) translations of the strings that appear in a perks
surface. Translation is switched on per account. Once it's on for yours, you
set the language on the page — data-lang on an embed, lang on a hosted
address — and Paylode renders it translated, with English filling in for
anything not yet translated. No translation work happens on your side, and
the wording stays consistent across every surface.
The language is yours to set. A page never switches language because of the visitor's browser settings.
Before you begin
- Ask your Paylode contact to enable translation for your account. Until it's enabled, your perks stay in English whatever language you set.
- Decide which surface you're localizing — an embedded page, a hosted page, or a custom page you render yourself. The first two are configuration; the last one is code.
- Know your target locale. Supported targets today are
ESandFR; English is the source and is always available as the fallback.
Set the language on your page
If you use the drop-in embed (see
Embed a perks page), set the locale on the container
element with data-lang:
<div
id="paylode-iframe-container"
data-slug="example-rewards"
data-lang="es"
></div>
If you use a Paylode-hosted page, pass the
locale as the lang query parameter on the page URL:
https://example-rewards.perkspulse.com/?lang=fr
In both cases Paylode renders the page's UI strings and localizable content in the requested language and falls back to English for anything not translated. You don't call the vocabulary API yourself. The Gift Shelf section of a page stays in English.
Request a language from the API
If you render your own page (see
Build a custom perk page), send the language
as the Accept-Language header when you fetch the collection:
curl https://perk-collections.paylode.com/perk-collections/example-rewards \
-H "X-API-Key: sk_example_0000000000" \
-H "Accept-Language: es"
const res = await fetch(
"https://perk-collections.paylode.com/perk-collections/example-rewards",
{
headers: {
"X-API-Key": "sk_example_0000000000",
"Accept-Language": "es",
},
}
);
const collection = await res.json();
Perk titles, descriptions and callouts come back translated, along with the names of their categories and locations. Send the same header when you fetch the collection's categories, so the filter labels match. Your own page's buttons and labels are yours to translate.
The full reference is
getPerkCollection
and
getPerkCollectionCategories
on the developer site.
Verify
- Load your surface with a target locale and confirm the UI strings render translated (for example, the Show more button reads Mostrar más in Spanish).
- Introduce a string you know isn't translated yet and confirm it renders in English rather than breaking or showing an empty label.
Troubleshooting
- The perks stay in English. Translation isn't enabled for your account yet. Ask your Paylode contact to switch it on.
- A label renders in English when you expected a translation. That string isn't in the vocabulary for that language yet, so the fallback kicked in. This is expected behavior — keep the English fallback in place so new strings always render.
Related
- Perk Pages overview — what the product does and how this page fits it.
- Embed a perks page — where
data-langlives. - Use a hosted perks page — the address you add
langto. - Build a custom perk page — the calls that take
Accept-Language. - Perks center — the branded surface these translations render into.