Internationalization
TaskOn widgets support locale configuration through TaskOnProvider.
Supported Locales
| Language | Code |
|---|---|
| English | en |
| Korean | ko |
| Japanese | ja |
| Russian | ru |
| Spanish | es |
Auto Detection
If locale is not set, the SDK uses browser language and falls back to en.
Manual Locale
import { TaskOnProvider } from "@taskon/widget-react/core";
<TaskOnProvider
config={{
clientId: "YOUR_CLIENT_ID",
locale: "ko",
}}
>
{children}
</TaskOnProvider>Preload Widget Locale Packs
Use preloadLocales to preload locale bundles for specific widgets:
<TaskOnProvider
config={{ clientId: "YOUR_CLIENT_ID", locale: "ja" }}
preloadLocales={["Quest", "CommunityTask", "LeaderboardWidget"]}
>
{children}
</TaskOnProvider>Why set preloadLocales?
- Non-English widget locale bundles are loaded asynchronously.
preloadLocalesstarts loading those bundles earlier during provider initialization.- This helps reduce first-render wait time when a widget is shown for the first time.
What if you do not set it?
- The SDK still works normally.
- Locale bundles are loaded on demand when each widget first renders.
- In non-English locales, first-time render can have a short locale-loading delay.
- If a locale bundle is missing or fails to load, the widget falls back to English strings.
Available preload names:
QuestCommunityTaskTaskWidgetLeaderboardWidgetUserCenterWidget
If a widget does not have a full locale pack for the active language, it falls back to English strings.
Last updated on