Lokalise
Use Lokalise for MainSDK translations - project and API token, main.yaml, locales, missing strings caught by the check, testing and swapping.
Lokalise is a translation management platform for product and engineering teams. Behind i18n, it holds your translations while your code keeps calling t(). Pick it when your team already manages strings in Lokalise.
Interfaces it serves
Pick Lokalise in main.yaml for any of these. Your calls stay the same, and you can swap later.
i18nPreviewDriver lokalise Lokalise
i18n:
driver: lokaliseSwap to another provider
Before you start
- Create a Lokalise project with the languages you ship, and note its project ID.
- Create an API token with access to the project.
- Store the token in your secrets manager.
Configure
i18n:
driver: lokalise
locales: [en-IN, hi-IN, ta-IN]
# [to be decided] project ID, and the API token as secret:LOKALISE_API_TOKENUse it
import { t } from "mainsdk";
export function heading(orders: unknown[]) {
return t("orders.count", { count: orders.length });
}Local development and testing
Build with the default files driver and switch to lokalise when translators join. In tests, createTestApp() from @mainsdk/testing runs i18n without a network, and chaos.on("i18n", { outage: true }) simulates Lokalise being unreachable.
What MainSDK adds on top
- A missing translation fails the check, not the user.
- Pseudo-localization in the check catches layout breaks before a translator sees them.
Limits and notes
- Planned driver from the product requirements;
i18nhas no spec yet. - How strings sync between your repo and Lokalise is not defined yet.
Swap to or from it
i18n:
driver: lokalise # was filesFAQ
Which file formats move in and out? MainSDK imports and exports XLIFF, iOS .xcstrings, Android strings and ICU JSON (byo-content).
Next
Open questions
Was this page helpful?