Display strings
Why raw API enums are wrong, and the catalog that fixes it.
Short page, and skipping it is the most common reason a first integration looks unfinished.
Two minutes. Skipping this is the most common reason a first integration looks unfinished.
The problem
The API returns enums. INACTIVE, ACTIVE, RESOLVING, ALLOCATED. Render one of those in a badge and a fan reads INACTIVE as “this quest is switched off”, when what it means is "you have not started this yet".
Raw enums are not just untranslated. Some of them are actively misleading.
The catalog
The SDK ships 719 English display strings. 584 cover every quest enum the API can return. The rest are the copy for events, the avatar editor and the leaderboard.
import { resolveMessage } from '@xborglabs/fanbase-react'
const label = resolveMessage(`Quests.status.${quest.status}`)Quests.*, 76 under Events.*, 33 under Inventory.*, 13 under Leaderboard.* and a handful of others.Signature
resolveMessage(
key: string,
i18n?: { t: (key: string, values?: object) => string },
values?: object
): stringThe second argument is an i18n adapter, not a fallback catalog. The English catalog is already the automatic fallback, so passing it explicitly is both unnecessary and wrong.
Values for interpolation go in the third argument.
Key namespaces
| Namespace | Covers |
|---|---|
Quests.status.* | Fan-facing quest progress |
Quests.prizeStatus.* | Prize and claim states |
Quests.gamingStatus.* | Game-linked quest states |
Leaderboard.* | Column headings, the pager, the empty and unranked states. Rendering a board. |
Events.* | Section titles, the join button, the timeline tiles, scoring columns, claim cards. Events. |
Inventory.* | The avatar editor: equip and unequip, rarity names, the save bar, the unsaved changes prompt. Avatars. |
Errors.globalErrors.* | Load and claim failures for events and the leaderboard |
A few strings sit on their own: Membership.getMembership, LoginButton.login, Profile.editMyAvatar, Profile.allTypes, Community.resetCamera and Community.downloadAvatar.
Many event and avatar strings carry placeholders for your own nouns, like {event}, {quests} or {item}. Pass them in the third argument, or the placeholder renders as written. Join {event} with { event: 'Tournament' } reads "Join Tournament".
The battlepass, the store and the newsfeed ship no strings. Their copy is yours: the SDK hands you reason codes and tier names, and you write the sentences.
Some real ones:
Quests.status.INACTIVE → “Not Started”
Quests.status.ACTIVE → "In Progress"
Quests.status.RESOLVING → "In Review"
Quests.prizeStatus.ALLOCATED → "Processing"INACTIVE to "Not Started" is the whole point of this page.
In practice
function QuestStatusBadge({ quest }) {
return (
<span className="your-badge">
{resolveMessage(`Quests.status.${quest.status}`)}
</span>
)
}Anywhere you were about to render {quest.status}, render this instead.
Your own wording
If your community says something different, wrap it:
const OVERRIDES = {
'Quests.status.RESOLVING': 'Being checked',
}
const label = (key) => OVERRIDES[key] ?? resolveMessage(key)Other languages
Pass your i18n instance as the adapter and your translations win, with the English catalog behind them for any key you have not covered:
resolveMessage('Quests.status.ACTIVE', { t: i18n.t })Set locale in httpOptions too, so API-side content comes back in the same language.
Where the SDK already does this for you
state.buttonLabel and state.disabledReasonLabel are already resolved. Render them directly. This page is about the raw fields you pull off the quest yourself.