# Languages The interface is in English and, for the parts people see every day, in Swedish. This page says how a person chooses, what is covered, and how to translate more. ## Choosing Open the user menu (your name, bottom of the sidebar) and press **English** or **Svenska** under *Language*. The whole screen is drawn again in that language at once, and the choice is **kept on your account**, so it follows you to any browser. Somebody who has never chosen gets the language their browser asks for — Swedish if it is set to Swedish, otherwise English — and that guess is not stored. The sign-in page follows the browser (or what this browser last used) since nobody is signed in yet. `` is set to match, for screen readers. The choice is one person's; an administrator cannot switch it for anyone else, and a viewer can use Swedish while the others use English. ## What is translated Swedish covers the menu and breadcrumbs, the shared parts (search, tables, pagination, empty lists, dialogs, toasts, "5 min ago"), the sign-in page and the user menu, and the headings, buttons, table columns, filters, labels and messages of the pages used every day: **Dashboard, Alerts, Servers (and a server's own page), Updates (with update runs, restarts and patch plans), Maintenance, My work, Coming up, To do, Integrations, Settings → Display**, and the history of integration figures. Texts that have no Swedish yet show in English, so a page can be half done without anything looking broken. Not translated yet: - **What the server writes** — alert messages, notifications and their channels, the weekly digest, the monthly report, e-mails, the change log's sentences, audit entries. These are made in many places on the server and are English; translating them is a separate piece of work. - The long explanatory introductions at the top of pages, and the less-used pages and settings, apart from words they share with the above (*Save*, *Cancel*, *Delete* …). - The documentation (these files). Dates and times keep following **Settings → Display** (year-month-day by default, which is also the Swedish habit). Numbers use the language's own separators only where a figure is formatted by the page itself. ## Adding to it (for whoever changes the code) English is the language the code is written in, and the English text is its own key: ```tsx import { t, tn } from "../i18n"; toast.success(t("Started updating {name}.", { name })); tn(n, "{n} server", "{n} servers") // the one form for 1, the many form otherwise ``` - The Swedish is an entry in `web/src/i18n/sv.ts`: `"Save": "Spara"`. A text with no entry is shown as written, so nothing breaks while it is waiting for a translation. - **Keep the `{placeholders}` the same** in the Swedish as in the English. A test (`server/test/language.test.ts`) checks that, that no entry is empty, and that every page of the menu has a Swedish name. - Brand and product names (Proxmox, Synology, Docker …) are the same in both languages and have no entry. - Do not call `t()` where a module is loaded (in a constant outside any component or function): it would be fixed to the language at that moment. Keep the English in the constant and call `t(label)` where it is drawn, as the menu (`layout/nav.tsx`) does. Where a constant holds a table of words, a getter does the same without touching where it is drawn: `{ get label() { return t("Running"); } }`. A test (`server/test/language.test.ts`) fails on any `t()` called outside a function. - Do not translate half a sentence that runs on into a link or more English: put the whole sentence in one `t()` with placeholders, or leave it all English. - A local variable called `t` hides the function; call such a variable something else (`todo`, `item`). - Changing the language re-draws the whole app (the tree is keyed on it), so no component needs to subscribe to anything. The account setting is `users.language` (`en`, `sv` or null for "follow the browser"); it is read with `GET /api/me` (`user.language`) and changed with `PUT /api/me/language` (`{ "language": "sv" }`, or `null`).