PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
1. i18n infrastructure
- 1.1 Add
i18next26,react-i18next17 andeslint-plugin-i18next6 tofrontend/package.json, and verifypnpm installsucceeds andpnpm buildstill passes - 1.2 Create
shared/i18n/locales/en.tsas a single object literal with the top-level namespaces (common,status,errors,languageholdingnativeName, plus one per domain), and verifypnpm buildpasses - 1.3 Add the
i18nextmodule augmentation typingresourcesastypeof en, exportTranslationKeyas an alias of i18next'sParseKeys, and verify thatt('does.not.exist')and aTranslationKeyholding an unknown key both failpnpm buildwhile real keys pass - 1.4 Create
shared/i18n/locales/ru.tsas a single object literal typedconst ru: typeof en, and verify that deleting one key and adding one stray key each makepnpm buildfail with that key named - 1.5 Configure the i18next instance with inline resources,
nsSeparator: false,interpolation.escapeValue: false,fallbackLng: 'en',react.transKeepBasicHtmlNodesFor: []andreact.transDefaultPropsescapingTransvalues (shouldUnescape: true,tOptions.interpolation.escapeValue: true), and verifyt()is typedstringat call sites andpnpm buildpasses - 1.6 Add the placeholder parity test, which asserts for every key of
enthat each other dictionary uses the same{{…}}names and the sameTranstags, and verifypnpm testpasses and fails when a placeholder is removed from aru.tsvalue - 1.7 Add a unit test that renders, through
react-dom/serverwith the project's i18next configuration, translated sentences containing the names<img src=x onerror=alert(1)>,<strong>bold</strong>anda {{name}} b: fromt()as React text, throughTransvalues, and throughTranswith the name as the child of a supplied element for a self-closing dictionary tag. Include a dictionary sentence with a<strong>the component does not supply. Verifypnpm testpasses; that every name is shown as text; that the element route shows each name exactly as entered; that the only elements produced are the ones the component supplies; and that the<strong>cases fail whenreact.transDefaultPropsorreact.transKeepBasicHtmlNodesForfrom 1.5 is removed - 1.8 Add
LocalizedText({ key: TranslationKey; params? }) in its own file inshared/i18ntogether with the way components render it, and verifypnpm buildrejects aLocalizedTextwith an unknown key - 1.9 Add
resolveInitialLocale({ storedLocale, browserLanguages, supportedLocales })inshared/i18n, and verify withpnpm testthat["de", "ru"]resolves toru, a list with no supported language resolves toen,zh-TWandzh-HKresolve tozhandpt-PTtoptwhen those are supported, a stored supported value outranks the browser list, and a stored unsupported value is ignored - 1.10 Add
LocaleProvideranduseLocaleinshared/i18n, mirroringshared/theme/ThemeProvider.tsx: the supported list is the dictionaries that exist (enandrufor now),databasus-localeis read fromlocalStorageduring initialization and resolved withresolveInitialLocale, and a switch updatesdayjs.localeandi18n.changeLanguagebefore publishing the new locale. Verifypnpm buildandpnpm testpass - 1.11 Wrap the tree in
LocaleProviderinApp.tsxand pass the matching AntD locale toConfigProvider. Withdatabasus-localeset toruinlocalStorage, verify that on first paint table pagination, an empty table and the month and weekday names in aDatePickerare already Russian, with no flash of English - 1.12 Set
document.documentElement.langand the document title from the selected locale at runtime, keepinglang="en"and the English<title>infrontend/index.htmlas the values shown before the script runs. Withdatabasus-localeset toru, verify the tab title is Russian and the reported language isruonce the page has loaded - 1.13 Add
formatNumberandformatRelativeTimeinshared/i18n, exposed throughuseLocale(), and verify with unit tests that an English browser with French selected groups digits the French way, that Chinese groups Western-style rather than in the 万 form, that unit words are not the formatter's concern, and that a relative time comes out in Russian when Russian is selected - 1.14 Confirm that
shared/time/getUserTimeFormat.ts:4,44andshared/time/utils.ts:5keep deriving clock format and date order fromnavigator.language, and record infrontend/AGENTS.mdwhy those three reads are correct where a baretoLocaleString()is not, so a later reader does not "fix" them - 1.15 Build
LanguageSelectorComponentandLanguageThemeControlComponentinshared/ui, keepingThemeToggleComponentas the theme half with split styling. The language half shows the current language and opens, on hover, a list of the supported languages, each named by its own dictionary'slanguage.nativeName; the list is an AntDDropdownopening on hover and click, whose leave delay keeps it open while the pointer crosses from the button to the list. Verify the list stays open while the pointer moves onto it - 1.16 Render
LanguageThemeControlComponentinstead ofThemeToggleComponentat all three call sites (widgets/main/MainScreenComponent.tsx:254,widgets/main/SidebarComponent.tsx:132,features/users/ui/AuthNavbarComponent.tsx:49) and verify the control renders in the navbar, in the narrow-viewport sidebar and on the authentication screen - 1.17 Add
WEBSITE_PAGESandgetWebsitePageUrl(page, locale)inshared/i18n, allow..inserver.fs.allowinfrontend/vitest.config.ts, and add the test that compares the table withTRANSLATED_PATHSread fromwebsite/app/i18n.ts?raw. Verifypnpm testpasses and fails when an untranslated page such asnotifiers/mattermostis marked translated, and thatpnpm buildpasses in a copy offrontend/with nowebsite/beside it, as in the Docker build - 1.18 Verify end to end with English and Russian that a language chosen before signing in survives the sign-in, that a browser preferring German and then Russian starts in Russian, that a browser with no supported language starts in English, that an explicit choice outranks the browser preference on later visits, and that switching the language keeps the unsaved input in a form on the page and keeps the narrow-viewport sidebar open when the switch is made from it
- 1.19 Change
descriptioninshared/ui/ConfirmationComponent.tsxfrom an HTML string rendered withdangerouslySetInnerHTML(:27) to aReactNoderendered as a child, and turn the description atfeatures/restores/ui/RestoresComponent.tsx:366into aTranskey with<bold>plus a second key for the question after the line breaks. Verifypnpm buildpasses, the restore cancellation dialog still shows the bold warning and the question on its own paragraph, and the other confirmation dialogs show their text unchanged
2. Lint enforcement and conventions
- 2.1 Define the
i18next/no-literal-stringoptions infrontend/eslint.config.jsas one shared object, not yet applied to any directory:allmode and the exclusion lists for the report classes in design.md (JSX attributes, callees, object properties, URL and path words,*.test.tsandapi/segments). Verify by applying it temporarily thatpnpm lintreports themessage.successtexts atfeatures/settings/ui/SettingsComponent.tsx:77,253and the fallback strings at:46and:79, reports theplaceholderattributes infeatures/storages, and reports none of the excluded classes in either; then remove the temporary entries and verifypnpm lintpasses - 2.2 Amend the "Language in code" section of the root
AGENTS.mdto permit target-language text infrontend/src/shared/i18n/locales/<locale>.tsand nowhere else underfrontend/src/, and verify the amended wording still forbids translated fallback copy and error messages outside that directory. Do not start section 5 until this task is done and approved - 2.3 Document the i18n convention in
frontend/AGENTS.md: keys are domain-scoped; English is the key source of truth; each dictionary is one object literal in one file; code outside components holds keys, not text; label tables are named<TYPE>_LABEL_KEYSand sit next to the type they label; sentences stay whole, withTransfor inline markup and interpolation instead of concatenation; a user-entered value in aTranssentence is a self-closing tag whose supplied element holds the value, never avaluesentry; counts are phrased without plural forms; translated text is never rendered as HTML; locale-dependent output is read throughuseTranslationoruseLocale, including relative times throughformatRelativeTime; API errors are shown throughtranslateApiError; technical strings stay literal. Scope the plain-hyphen rule toen.tsand point the other dictionaries towebsite/AGENTS.md- Translation quality. Verify the section states each rule and links to that section - 2.4 In
website/AGENTS.md, state that "Translation quality" also governs the frontend dictionaries, and add to theTRANSLATED_PATHSrule that a frontend test checks the application's links to website pages against that list, so adding or removing a translated path can fail it. Verify both notes are present
3. Error handling contract
- 3.1 Add an
errorsnamespace keyed by error code. Inshared/api/apiHelper.ts, makeApiError.messagehold only the backend's message, add astatusfield set on everyApiErrorfrom an error response, and give the failures the backend does not describe frontend-side codes: wrap only the rejection of thefetchcall at:59as anApiErrorwithnetwork_unreachable, letting theApiErrors that reach thecatchat:62pass through unchanged, and throwrequest_failedfor HTTP 502 and 504 at:20-21and for an error response without a JSON body at:44-46. Delete the deadresponse.text()fallback at:37-41. SwitchdescribeRestoreError(PhysicalRestoreComponent.tsx:34-44) to deciding bystatusalone, dropping its search of the message for409,422,in progressandgap, and turn the hints it appends into keys. AddtranslateApiError(error, t)inshared/i18n/translateApiError.ts, which resolves a known code to its translation, otherwise shows the backend's message, otherwise a general translated message, and never shows the message of an error that is not anApiError. Verify with unit tests. FortranslateApiError: a known code, an unknown code with a message, an unknown code without a message, no code with a message,network_unreachable,request_failedwith its status, and a plainTypeError. ForapiHelper, withglobalThis.fetchstubbed: a rejection givesnetwork_unreachable, a 502 givesrequest_failedwith status 502, a non-JSON 500 givesrequest_failedwith status 500, and a JSON error with a code keeps its code, message and status. Cover both the default path, where the first try is the last, and a call made withisRetryOnError, which is retried up to 30 times at 3-second intervals (apiHelper.ts:6-7,76,88) and needs fake timers - 3.2 Convert the text in
physicalConnectionErrorContentto keys while keeping its lookup byConnectionErrorCode: titles and summaries become keys, each note becomes one key rendered throughTranswith<bold>tags instead of text runs,managedNotebecomes a key with{{username}}, and commands stay literal. Route every other code inEditPostgreSqlPhysicalSpecificDataComponent.tsxthroughtranslateApiError. Verifypnpm testpasses and that each physical connection error still shows its specific copy
4. Enum labels
- 4.1 Add a
statusnamespace and a<TYPE>_LABEL_KEYStable next to each of the six status enums inentity/that are shown as labels (AddMemberStatusEnumis never shown, so it gets none), moving the label parts ofphysicalBackupStatus.tsandrestoreVerificationStatus.tsthere (withNOT_VERIFIED: nullreplacing thePartial), and convertAGENT_STATUS_LABELStoAGENT_STATUS_LABEL_KEYSin place. Verify that adding an enum member without a label failspnpm build - 4.2 Replace the four status render functions (
VerificationDetailDrawer.tsx:51,VerificationsComponent.tsx:58,LogicalBackupsComponent.tsx:386,PhysicalBackupsComponent.tsx:55) with lookups against the shared tables, keeping each component's own markup, and verify the four screens show the same English labels as before, and Russian labels when Russian is selected - 4.3 Add
<TYPE>_LABEL_KEYStables next to the other labelled types: storage and notifier types, database types, SSH tunnel auth types, notification types, intervals, periods, retention policies, user and workspace roles, and one weekday table inentity/intervals. This task only adds the tables; the old sources (getStorageNameFromType,getNotifierNameFromType, thegetRoleDisplayTextswitches, the six weekday copies and the other text tables) are deleted by the section 5 task that migrates their last consumer. Verify that adding an enum member without a label failspnpm build
5. Slice migration (English and Russian together)
Ordering is deliberate and not by size alone. features/settings comes first to prove the infrastructure on the smallest slice. features/databases comes second, out of size order, because it is the largest and most varied slice: if the key namespace design breaks anywhere it breaks there, and finding that out after nine migrated slices would mean reworking all of them. The cost is doing the hardest slice before the pattern is fluent. The rest then run ascending.
A slice is done when:
its copy is in the dictionaries, following the
frontend/AGENTS.mdconvention from 2.3;its consumers of the section 4 tables use keys, and any old label function or copy whose last consumer it held is deleted;
its
fromNow()calls go throughformatRelativeTime, itstoLocaleString()calls throughformatNumber, and every place that shows an error's message, whether throughalert(),message.error()or its own error state, throughtranslateApiError;its links to databasus.com pages go through
getWebsitePageUrl;it has a lint entry using the options from 2.1;
pnpm formatleaves no changes, andpnpm lint,pnpm testandpnpm buildpass;the reviewer subagent has audited the slice's diff and every CHANGES REQUIRED finding is resolved.
5.1 Migrate
features/settings, and verify the slice is done and that the relative times in the audit log (AuditLogsComponent.tsx:160,198) re-render in the new language on a live switch5.2 Migrate
features/databases, the largest slice. Then review whether the namespace design survived it and revise the key layout before continuing if it did not, and record the Russian canonical interface terms inwebsite/AGENTS.md- Translation quality. Verify the slice is done5.3 Migrate
features/restores, and verify the slice is done5.4 Migrate
features/healthcheck, and verify the slice is done5.5 Migrate
features/workspaces, phrasing the counts atWorkspaceMembershipComponent.tsx:517andWorkspaceSettingsComponent.tsx:148so one string fits every number, and verify the slice is done5.6 Migrate
features/users, replacing the backend's success text shown atRequestResetPasswordComponent.tsx:54with a frontend key, and verify the slice is done5.7 Migrate
features/verification, including the baretoLocaleString()calls atVerificationDetailDrawer.tsx:45,48,157, and verify the slice is done5.8 Migrate
features/notifiers, and verify the slice is done5.9 Migrate
features/backups, including the baretoLocaleString()calls atLogicalBackupsComponent.tsx:513,515andPhysicalBackupsComponent.tsx:49,52, and verify the slice is done5.10 Migrate
features/storages, and verify the slice is done5.11 Migrate the remaining copy in
entity/,widgets/,pages/andshared/ui/, including the baretoLocaleString()atStarButtonComponent.tsx:56. The connection string parsers return{ error: LocalizedText }, the parse-failure keys drop the thrown error's text that eleven messages append today (for exampleConnectionStringParser.ts:137), and their tests (ConnectionStringParser.test.ts,MySqlConnectionStringParser.test.ts,MongodbConnectionStringParser.test.ts) assert keys instead of English words. Verify the slice is done5.12 Replace the per-directory lint entries with one entry over
src/**/*.{ts,tsx}, delete the temporaryeslint.i18n-check.js, and verifypnpm lintpasses and fails when a literal label is added to any file undersrc, including inside a SCREAMING_SNAKE constant5.13 Fold the per-namespace files
locales/en/*.tsandlocales/ru/*.tsback into one object literal inlocales/en.tsand one inlocales/ru.ts, delete both folders, and verifypnpm buildstill names a missing and a stray key andpnpm testpasses
6. Remaining languages
Each dictionary follows the locale conventions in website/AGENTS.md - Translation quality. Writing one includes adding the language to the supported list, the AntD locale map and the dayjs locale map, and recording its canonical interface terms next to the Russian ones. Like a slice, each ends with pnpm format leaving no changes, pnpm build and pnpm test passing (no missing or stray keys, placeholders in parity), and a reviewer audit with every CHANGES REQUIRED finding resolved.
- 6.1 Confirm the key set has stopped changing after section 5, then write
es.ts, and verify the checks above and that a first visit from a browser preferring Spanish starts in Spanish - 6.2 Write
pt.ts(Brazilian Portuguese), and verify the checks above and that a first visit from a browser preferringpt-PTstarts in Portuguese - 6.3 Write
fr.ts, and verify the checks above and that a first visit from a browser preferring French starts in French - 6.4 Write
zh.ts(Simplified), and verify the checks above and that a first visit from a browser preferringzh-TWstarts in Simplified Chinese - 6.5 Verify the language list shows all six native names in every interface language and that each language renders end to end
7. Verification
- 7.1 Walk every screen in Russian and French looking for clipped or wrapped labels in AntD forms with fixed
labelCol, and fix the layouts that break - 7.2 Spot-check Chinese on the table-heavy screens (backups, databases, verification runs) for line height and CJK-Latin spacing
- 7.3 Confirm in every language that command blocks, connection strings, cron expressions, engine names and the unit words in duration and size readouts are byte-identical to English, while the digits inside those readouts follow the selected language
- 7.4 Confirm in every language that the browser tab title and the document language attribute match the selection, that
grep -rn "toLocaleString()" frontend/srcfinds nothing, thatgrep -rn "\.fromNow()" frontend/srcfinds only the call insideformatRelativeTime, thatgrep -rnE "(\b(e|err)|[Ee]rror\)?)\.message\b" frontend/srcfinds nothing outsideshared/i18n/translateApiError.tsand test files exceptEditS3StorageComponent.tsx, which reads anApiError's message only to decide whether to open the advanced settings on a TLS certificate failure and never shows it (behavior that predates this change; a backend error code would replace it), and thatgrep -rn "dangerouslySetInnerHTML" frontend/srcfinds nothing - 7.5 Confirm in every language that each link to a databasus.com page opens that page in the selected language when the website publishes it and the English page otherwise, landing on its anchor, and that
grep -rnF "databasus.com" frontend/srcfinds page URLs only inWEBSITE_PAGES, apart from the example icon URL in the Mattermost form - 7.6 Switch the language on a screen with a half-filled form, from the navbar and from the narrow-viewport sidebar, and confirm the input and the open sidebar stay as they were, now in the new language
- 7.7 Run
pnpm lint,pnpm format,pnpm testandpnpm buildfromfrontend/and confirm all pass - 7.8 Run the reviewer subagent over the change's full diff against
developand resolve every CHANGES REQUIRED finding