Skip to main content

Translations

When starting the login flow, you can pass an object with translations as a query parameter. This allows you to override or translate the default strings on the login pages.

CentralAuth NPM library

When using the CentralAuth NPM library, you can pass the translations object as config parameter to the login or loginHTTP method, for example:

await authClient.login(req, {
translations: {
login: "Welcome! Log in to My Website.",
loginAttemptSuccess: "That's all folks! Close this tab and be on your merry way.",
loginAttemptError: "Oops! Something went wrong. Please try again.",
undo: "Undo login at My Website"
}
});

Manual integration

If you cannot use the NPM library, you can pass the translations object as a base64 stringified JSON object in the translations query parameter of the login URL. For example:

const translations = {
login: "Welcome! Log in to My Website.",
loginAttemptSuccess: "That's all folks! Close this tab and be on your merry way.",
loginAttemptError: "Oops! Something went wrong. Please try again.",
undo: "Undo login at My Website"
};

const translationsBase64String = Buffer.from(JSON.stringify(config.translations)).toString("base64");

const loginUrl = `https://centralauth.com/login?translations=${translationsBase64String}&client_id=CLIENT_ID&response_type=code&redirect_uri=REDIRECT_URI&state=STATE`;

Available translations

You can set the following translations:

KeyDescriptionDefault value
emailAddressThe label of the email address input field.Email address
loginPageIntroThe introductory text on the login page.Welcome to organization name. How would you like to log in?
loginPagePasskeyAuthenticationThe button label for using an existing passkey.Use an existing passkey
loginPagePasskeyRegistrationThe button label for registering a new passkey.Register a new passkey
loginPagePasskeyIntroThe introductory text for passkey login.A passkey is a modern, safe and simple way to log in using an authentication method from your own device, like your fingerprint, Face ID or Windows Hello. Please verify your email address to start registration for a new passkey. You only have to do this once.
loginPagePasskeyOrganizationWarningThe warning message when a passkey was used for a wrong organization.This passkey was not registered for this organization. Please register a new passkey.
loginPagePasskeyErrorThe error message for a failed passkey login.The authentication failed. Please try again or register a new passkey.
loginPageEmailIntroThe introductory text for email login.Please enter your email address to log in at organization name.
loginPageEmailErrorThe error message for a failed email login.Please enter a valid email address.
loginPageCaptchaThe label for the Captcha checkbox.I am a human
loginPageCaptchaChallengeTextThe text for the Captcha number challenge.Please click the numbers from lowest to highest.
loginPageCaptchaPuzzleTextThe text for the Captcha puzzle challenge.Please click the only open circle in the image.
loginPageCaptchaLockTextThe text for the Captcha lock rotation challenge.Please align the image with the background. Drag the image or use the buttons to rotate it.
loginPageCaptchaErrorThe error message for the Captcha challenge.Please click the checkbox to verify you're a human.
suspiciousActivityDetectedThe error message for the AI bot detection.Suspicious activity detected. Please try again later.
emailLinkSubjectThe email subject for an email containing a login link.One-time login link
emailCodeSubjectThe email subject for an email containing a login code.One-time login code
emailLinkBodyThe email body for an email containing a login link.Hi! You are receiving this email because you're trying to log in at organization name. Click the link below to confirm you want to log in.
emailCodeBodyThe email body for an email containing a login code.Hi! You are receiving this email because you're trying to log in at organization name. Please copy the code below to your browser to log in.
emailWaitUntilThe warning message for too many login attempts. A counter will be displayed after this text.Please wait a little longer before trying to log in again:
emailBodyWarningThe message below the login link and code email.If you didn't try to log in, don't click on the link and just delete this email.
emailChallengeTextThe text for the login challenge email.Please click the number you see in your browser:
loginThe label for the login button, both on the login page and in the email.Log in at organization name
loginWithPasskeyThe label for the passkey login button.Log in with a passkey
loginLocalThe label for the local login button when the login method is user choice.Log in to this device
loginRemoteThe label for the remote login button when the login method is user choice.Log in to your existing session
loginAttemptBodyThe text on the login page when an email with a login link was sent.A mail has been sent to your email address with the following token. Please keep this tab open and continue to your email.
loginAttemptCodeBodyThe text on the login page when an email with a login code was sent.A mail has been sent to your email address with a one-time login code. Please enter the code here to log in.
loginAttemptSuccessThe text on the login page when the login attempt was successful, shown in the tab where the login flow was started.Done! You can now close this tab and return to your session.
loginAttemptErrorThe error message on the login page when the login attempt was unsuccessful.Something went wrong... Please close this tab and try again.
undoThe label of the undo button.Undo