TRANSLATIONS FOR AUTH VIEWS

To ensure the new authentication views support multiple languages, you need to define the translation keys for all user-facing text used in AuthLogin and AuthRegister.

Defining Keys in Locale File

You must add these translation keys and their corresponding English values to the appropriate locale file, typically locale/en.lua (for English).

The format within the .lua file is: ["key"] = "value",

Add the following keys to your locale/en.lua file. These keys correspond to the strings used in Auth.tsx:

-- Add these keys to the locale/en.lua file:

["Userbar:Title"] = "Welcome",

["Auth:Pages.Login.Title"] = "Login",
["Auth:Pages.Login.Form.Username"] = "Username",
["Auth:Pages.Login.Form.Password"] = "Password",
["Auth:Pages.Login.Form.Button"] = "Login",
["Auth:Pages.Login.Form.NoAccount"] = "Don't have an account?",
["Auth:Pages.Login.Form.NoAccount.Register"] = "Register",

["Auth:Pages.Register.Title"] = "Register",
["Auth:Pages.Register.Form.Username"] = "Username",
["Auth:Pages.Register.Form.Password"] = "Password",
["Auth:Pages.Register.Form.RepeatPassword"] = "Repeat Password",
["Auth:Pages.Register.Form.Button"] = "Register",
["Auth:Pages.Register.Form.HasAccount"] = "Already have an account?",
["Auth:Pages.Register.Form.HasAccount.Login"] = "Login",

["Auth:Errors.Error"] = "An error occurred",
["Auth:Messages.FillAllFields"] = "Please fill in all fields",
["Auth:Messages.AccountCreated"] = "Account created successfully",
["Auth:Messages.InvalidOldPassword"] = "Invalid old password",
["Auth:Messages.InvalidPassword"] = "Invalid password",
["Auth:Messages.InvalidUsernameOrPassword"] = "Invalid username or password",
["Auth:Messages.InvalidUserOrApp"] = "Invalid user ID or app name",
["Auth:Messages.InvalidUser"] = "Invalid user ID",
["Auth:Messages.NoValidUsers"] = "No valid users found",
["Auth:Messages.UsernameExists"] = "Username already exists",
["Auth:Messages.UpdatedSuccessfully"] = "Updated successfully",
["Auth:Messages.AllFieldsRequired"] = "All fields are required",
["Auth:Messages.DifferentPassword"] = "Passwords do not match",
["Auth:Messages.Logout"] = "You have been logged out of the app due to login on another device.",

Localization for Other Languages

To support other languages, repeat this process by creating or editing the corresponding locale file (e.g., locale/fr.lua) and adding the same keys with their appropriate localized values.

Last updated