Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add core/i18n scripts (#2434)
Leendert de Borstb1e20c720b8a
diff --git a/core/i18n/hints.json b/core/i18n/hints.jsonnew file mode 100644index 000000000..448fa245e--- /dev/null+++ b/core/i18n/hints.json@@ -0,0 +1,568 @@+{+ "apiErrors.USERNAME_AVAILABLE": "Message shown when username is available",+ "apiErrors.USERNAME_REQUIRED": "Error message when username is empty",+ "app.status.unlockingVault": "Loading message while unlocking vault",+ "auth.forgotPassword.contactAdministrator": "Instructions to contact server administrator when no support email is available",+ "auth.forgotPassword.contactSupportWithEmail": "Instructions to contact support when support email is available. {0} is placeholder for email address",+ "auth.forgotPassword.lostPasswordTitle": "Title for the forgot password page",+ "auth.forgotPassword.newAccountRequired": "Warning about needing to create a new account and data loss",+ "auth.forgotPassword.noRecoveryExplanation": "Explanation that password recovery is not possible due to encryption",+ "auth.forgotPassword.recentlyChangedPasswordTitle": "Section title for recently changed password help",+ "auth.loggingIn": "Loading message during login process",+ "auth.loginForm.authenticatorCodeLabel": "Label for 2FA code input field",+ "auth.loginForm.dontHaveAuthenticatorText": "Question text about not having access to authenticator",+ "auth.loginForm.loginErrorMessage": "Generic login error message",+ "auth.loginForm.loginRequestErrorMessage": "Login request processing error message",+ "auth.loginForm.loginWithAuthenticatorLink": "Link text for logging in with authenticator",+ "auth.loginForm.loginWithRecoveryCodeLink": "Link text for logging in with recovery code",+ "auth.loginForm.lostPasswordLink": "Link text for password recovery",+ "auth.loginForm.recoveryCodeDescription": "Description for recovery code step",+ "auth.loginForm.recoveryCodeLabel": "Label for recovery code input field",+ "auth.loginForm.recoveryCodeVerificationTitle": "Title for recovery code step",+ "auth.loginForm.regainedAccessText": "Question text about regaining access to authenticator",+ "auth.loginForm.rememberMachineLabel": "Label for remember machine checkbox",+ "auth.loginForm.twoFactorAuthenticationDescription": "Description for 2FA step",+ "auth.loginForm.verifyingRecoveryCodeMessage": "Loading message during recovery code verification",+ "auth.loginForm.verifyingTwoFactorCodeMessage": "Loading message during 2FA verification",+ "auth.mobileUnlock.scanQrCodeDescription": "Description instructing user to scan QR code",+ "auth.passwordPlaceholder": "Label for password input field",+ "auth.pinInput": "Screen reader label of the PIN entry field",+ "auth.register.passwordLabel": "Label for password input field",+ "auth.register.passwordPlaceholder": "Placeholder text for password input",+ "auth.register.registrationErrorMessage": "Generic registration error message",+ "auth.register.termsAndConditionsLink": "Link text for terms and conditions",+ "auth.register.usernameOrEmailLabel": "Label for username/email input field",+ "auth.setup.createAccountButton": "Button text for creating account",+ "auth.setup.creatingStepTitle": "Title for the vault creation step",+ "auth.setup.passwordStep.confirmMasterPasswordLabel": "Label for confirm password field",+ "auth.setup.passwordStep.confirmMasterPasswordPlaceholder": "Placeholder for confirm password field",+ "auth.setup.passwordStep.importantNote": "Important warning about master password",+ "auth.setup.passwordStep.masterPasswordPlaceholder": "Placeholder for master password field",+ "auth.setup.passwordStep.securityPoint1": "First security point about password privacy",+ "auth.setup.passwordStep.securityPoint2": "Second security point about server access",+ "auth.setup.passwordStep.securityPoint3": "Third security point about password recovery",+ "auth.setup.passwordStep.welcomeMessage": "Assistant welcome message for password setup step",+ "auth.setup.passwordStepTitle": "Title for the password creation step",+ "auth.setup.setupStepTitle": "Default setup step title",+ "auth.setup.termsAndConditionsStepTitle": "Title for the terms and conditions step",+ "auth.setup.termsStep.agreementCheckboxLabel": "Label for the agreement checkbox",+ "auth.setup.termsStep.pleaseReadAndAgree": "Instructions to read and agree to terms",+ "auth.setup.termsStep.termsContent": "Full terms and conditions content",+ "auth.setup.usernameStep.assistantAvatarAlt": "Alt text for assistant avatar image",+ "auth.setup.usernameStep.enterUsernameInstructions": "Instructions for entering username",+ "auth.setup.usernameStep.greatNowLetsSetupUsername": "Assistant message about setting up username",+ "auth.setup.usernameStep.rememberUsernameNote": "Important note about remembering username",+ "auth.setup.usernameStep.serverCommunicationError": "Error message for server communication issues",+ "auth.setup.usernameStep.usernamePlaceholder": "Placeholder text for username input",+ "auth.setup.usernameStep.validatingUsernameMessage": "Message shown while validating username",+ "auth.setup.usernameStepTitle": "Title for the username selection step",+ "auth.start.httpsWarningMessage": "Message explaining why HTTPS is required",+ "auth.start.httpsWarningTitle": "Title for HTTPS warning banner",+ "auth.start.loginExistingAccountButton": "Button text for logging in with existing account",+ "auth.start.mainTitle": "Main title of the application",+ "auth.start.taglineText": "Tagline emphasizing privacy protection",+ "auth.switchAccounts": "Text before logout link",+ "auth.unlockPage.connectionFailedError": "Error message for server connection failure",+ "auth.unlockPage.enterMasterPasswordDescription": "Description for password unlock form",+ "auth.unlockPage.incorrectPasswordError": "Error message for incorrect password",+ "auth.unlockPage.loggingInWithWebAuthn": "Message shown while WebAuthn authentication is in progress",+ "auth.unlockPage.quickUnlockDescription": "Description explaining WebAuthn unlock options",+ "auth.unlockPage.sessionTimedOutError": "Error message for session timeout",+ "auth.unlockPage.unlockButton": "Button text for unlock submission",+ "auth.unlockPage.unlockWithMobileButton": "Button text for unlocking with mobile app",+ "auth.unlockPage.unlockWithWebAuthn": "Button text for WebAuthn unlock",+ "auth.unlockPage.webAuthnNotSupportedError": "Error message when WebAuthn is not supported",+ "common.attachmentDownloadFailed": "Error message when attachment download fails",+ "common.attachments": "Email attachments section header",+ "common.back": "Button text for going back",+ "common.backspace": "Screen reader label of the delete-last-digit key on the PIN pad",+ "common.cancel": "Button text for canceling an action",+ "common.clientVersionUnsupported": "Shown when the server rejects the client version (HTTP 426).",+ "common.clipboardCountdown.clearClipboardButton": "Button text to manually clear clipboard immediately",+ "common.close": "Button text for closing a dialog or modal",+ "common.confirm": "Button text to confirm an action",+ "common.continue": "Button text to continue with an action",+ "common.delete": "Button text for deleting an item",+ "common.duplicate": "Button text for duplicating an item",+ "common.duplicateErrorMessage": "Error message shown when duplicating an item failed",+ "common.duplicateSuccessMessage": "Success message shown after duplicating an item",+ "common.edit": "Button text for editing an item",+ "common.email": "Label for email input field",+ "common.emailItemLabel": "Label for the credential/item row in the email header. Shared between email modal and email page.",+ "common.error": "Error status message",+ "common.errorGeneric": "Generic error message",+ "common.errorPasswordMismatch": "Password confirmation mismatch error",+ "common.generate": "Button tooltip for generating a random value",+ "common.help": "Screen reader label of a help button",+ "common.hide": "Button text for hiding content",+ "common.home": "Home breadcrumb text",+ "common.loading": "Loading message displayed during async operations",+ "common.loadingVault": "Status text when vault is being loaded",+ "common.lockVault": "Tooltip text for lock vault button",+ "common.next": "Button text for proceeding to the next step",+ "common.no": "Rejection button text",+ "common.notes": "Notes section heading",+ "common.ok": "OK button text",+ "common.or": "Divider text between options",+ "common.pageNavigation": "Screen reader label of the pagination bar",+ "common.password": "Label for password input field",+ "common.passwordStrength.fair": "Password strength level: acceptable strength",+ "common.passwordStrength.good": "Password strength level: strong password",+ "common.passwordStrength.strong": "Password strength level: very strong password",+ "common.passwordStrength.title": "Label for password strength indicator",+ "common.passwordStrength.veryWeak": "Password strength level: encouraging message for short passwords",+ "common.passwordStrength.weak": "Password strength level: positive progress message",+ "common.previous": "Pagination button to the previous page",+ "common.qrCode": "Alternative text of a QR code image",+ "common.refresh": "Button text to refresh content",+ "common.remove": "Button text for removing an item",+ "common.save": "Button text for saving changes",+ "common.serviceName": "Label for service name field",+ "common.show": "Button text for showing content",+ "common.success": "Success status message",+ "common.syncingChanges": "Status text when background sync is in progress",+ "common.syncVaultData": "Tooltip text for sync vault data button",+ "common.unavailable": "Shown instead of the size, or in brackets after the name, of a file whose data could not be loaded",+ "common.username": "Label for username input field",+ "common.vaultSaveError": "Generic error shown when a vault save / sync to the server fails for an unexpected reason",+ "common.verifyingPassword": "Message shown while verifying password",+ "common.yes": "Confirmation button text",+ "emails.home.autoRefreshEnabledTooltip": "Tooltip for auto-refresh indicator",+ "emails.home.bulkDeleteEmailConfirmation": "Delete multiple emails confirmation message. {0} is placeholder for total number of to be deleted emails",+ "emails.home.bulkDeleteEmailSuccess": "Success message when multiple emails are deleted. {0} is placeholder for total number of deleted emails",+ "emails.home.bulkDeleteEmailTitle": "Delete multiple emails confirmation dialog title",+ "emails.home.claimDoesNotExistError": "Error message when email claim does not exist",+ "emails.home.deleteSelectedEmails": "Delete selected emails button text",+ "emails.home.noEmailClaimsMessage": "Message when no email addresses are configured",+ "emails.home.noEmailsReceivedMessage": "Message when no emails are received",+ "emails.home.pageDescription": "Page description",+ "emails.modal.attachmentDownloadError": "Error message for attachment download error",+ "emails.modal.deleteEmailConfirmation": "Delete email confirmation message",+ "emails.modal.emailDeletedSuccess": "Success message when email is deleted",+ "emails.modal.emailDeleteFailed": "Error message when email deletion fails",+ "emails.modal.noEmailBody": "Message shown when email has no content",+ "emails.preview.selectEmailMessage": "Empty state message when no email is selected",+ "emails.recent.noEmailsReceivedMessage": "Message when no emails are available",+ "emails.recent.subjectColumn": "Table column header for email subject",+ "emails.row.newEmailTooltip": "Tooltip text for new email indicator",+ "emails.title": "Main navigation link for emails section",+ "fieldLabels.alias.birthdate": "Label for birthdate field",+ "fieldLabels.alias.first_name": "Label for first name field",+ "fieldLabels.alias.gender": "Label for gender field",+ "fieldLabels.alias.last_name": "Label for last name field",+ "fieldLabels.card.cardholder_name": "Label for cardholder name field",+ "fieldLabels.card.cvv": "Label for CVV field",+ "fieldLabels.card.expiry_month": "Label for expiry month field",+ "fieldLabels.card.expiry_year": "Label for expiry year field",+ "fieldLabels.card.number": "Label for card number field",+ "fieldLabels.card.pin": "Label for PIN field",+ "fieldLabels.login.email": "Label for email field",+ "fieldLabels.login.password": "Label for password field",+ "fieldLabels.login.url": "Label for URL field",+ "fieldLabels.login.username": "Label for username field",+ "fieldLabels.notes.content": "Label for notes content field",+ "importExport.exportAvexButton": "Button to export encrypted vault as .avex archive",+ "importExport.exportAvexDescription": "Description for encrypted export option",+ "importExport.exportAvexTitle": "Title for encrypted export option",+ "importExport.exportAvuxButton": "Button to export full vault as .avux archive",+ "importExport.exportAvuxDescription": "Description for unencrypted full export option",+ "importExport.exportAvuxTitle": "Title for unencrypted full export option",+ "importExport.exportCsvButton": "Button to export as CSV",+ "importExport.exportCsvDescription": "Description for CSV export option",+ "importExport.exportCsvTitle": "Title for CSV export option",+ "importExport.exportEncryptedPasswordDescription": "Description for export password modal with security warning",+ "importExport.exportEncryptedPasswordTitle": "Title for export password modal",+ "importExport.exportEncryptedWarningMessage": "Warning message for encrypted export confirmation",+ "importExport.exportingVaultMessage": "Message shown while exporting vault",+ "importExport.exportPasswordConfirmTitle": "Title for password confirmation modal during export",+ "importExport.exportPasswordModal.confirmExportPasswordLabel": "Label for password confirmation field",+ "importExport.exportPasswordModal.createEncryptedExportButton": "Button text for creating encrypted export",+ "importExport.exportPasswordModal.exportPasswordLabel": "Label for export password input field",+ "importExport.exportSectionDescription": "Export section description",+ "importExport.exportSuccessMessage": "Success message after vault export completes",+ "importExport.exportWarningMessage": "Export warning confirmation message",+ "importExport.importSectionDescription": "Import section description with HTML link",+ "importExport.importSectionTitle": "Import section title",+ "importExport.pageDescription": "Page description",+ "importExport.passwordIncorrect": "Error message when password verification fails",+ "importExport.passwordVerificationFailed": "Generic error message for password verification failure",+ "importExport.recommendedLabel": "Label for recommended option",+ "importExport.serviceCard.attachmentsDetected": "Info text showing number of attachments detected and their total size. {0} is the count, {1} is the human-readable size (e.g. \"3.9 MB\")",+ "importExport.serviceCard.confirmImportText": "Confirmation text before importing. {0} is the credential count",+ "importExport.serviceCard.decryptAndContinueButton": "Button text for decryption",+ "importExport.serviceCard.decryptingFile": "Progress text during decryption",+ "importExport.serviceCard.decryptionErrorGeneric": "Generic error message for decryption failure",+ "importExport.serviceCard.decryptionPasswordHint": "Hint explaining what password is needed",+ "importExport.serviceCard.decryptionPasswordLabel": "Label for decryption password input",+ "importExport.serviceCard.duplicateCredentialsWarning": "Warning text when duplicate credentials are detected. {0} is the count",+ "importExport.serviceCard.encryptedFilePasswordPrompt": "Prompt for encrypted file password",+ "importExport.serviceCard.extractFaviconsLabel": "Checkbox label for favicon extraction option",+ "importExport.serviceCard.extractingFavicons": "Progress text during favicon extraction. {0} is current progress, {1} is total",+ "importExport.serviceCard.faviconExtractionNote": "Warning note about favicon extraction duration",+ "importExport.serviceCard.foldersDetected": "Info text showing number of folders detected in the import. {0} is the count",+ "importExport.serviceCard.importAttachmentsLabel": "Checkbox label for importing file attachments detected in the source export",+ "importExport.serviceCard.importButton": "Import button text",+ "importExport.serviceCard.importErrorCopyDetailsButton": "Button label to copy the error diagnostic block to the clipboard",+ "importExport.serviceCard.importErrorDetailsIntro": "Intro line shown above the copyable error diagnostic block when an import fails",+ "importExport.serviceCard.importErrorFileTooLarge": "Error message when file is too large. {0} is the maximum allowed size in megabytes",+ "importExport.serviceCard.importErrorGeneric": "Generic error message when import fails",+ "importExport.serviceCard.importErrorInvalidFile": "Error message when invalid file is selected",+ "importExport.serviceCard.importErrorUnsupportedFormat": "Error message when user selects an unsupported file format. {0} is the list of supported extensions",+ "importExport.serviceCard.importFoldersLabel": "Checkbox label for importing folder structure from the source password manager",+ "importExport.serviceCard.importFromServiceTitle": "Modal title for importing from a service. {0} is placeholder for service name",+ "importExport.serviceCard.importPartialFailureWarning": "Warning shown in the preview step when some items failed to parse. {0} is the count of failed items",+ "importExport.serviceCard.importSuccessMessage": "Success message after import completes. {0} is the credential count",+ "importExport.serviceCard.moreCredentials": "Text showing additional credentials not displayed. {0} is the count",+ "importExport.serviceCard.noLogoText": "Text shown when service logo is not available",+ "importExport.serviceCard.noNewCredentials": "Warning text when no new credentials are available for import",+ "importExport.serviceCard.previewInstructions": "Instructions shown before the credential preview table",+ "importExport.serviceCard.savingCredentials": "Progress text during credential save. {0} is current progress, {1} is total",+ "importExport.serviceCard.serviceColumn": "Column header for service name in credential preview table",+ "importExport.serviceCard.supportedFormats": "Label for supported file formats",+ "importExport.serviceCard.syncingVault": "Progress text when syncing vault to server after import",+ "importExport.serviceCard.uploadExportFileText": "Text for file upload instruction. {0} is placeholder for service name",+ "importExport.services.aliasVaultDescription": "Description for AliasVault import service",+ "importExport.services.aliasVaultInstructionsPart1": "AliasVault import instructions",+ "importExport.services.bitwardenDescription": "Description for Bitwarden import service",+ "importExport.services.bitwardenInstructionsPart1": "Bitwarden export instructions part 1",+ "importExport.services.chromeDescription": "Description for Chrome import service",+ "importExport.services.chromeInstructionsPart1": "Chrome export instructions part 1",+ "importExport.services.dashlaneDescription": "Description for Dashlane import service",+ "importExport.services.dashlaneInstructionsPart1": "Dashlane export instructions part 1",+ "importExport.services.dashlaneInstructionsPart2": "Dashlane export instructions part 2",+ "importExport.services.dropboxDescription": "Description for Dropbox import service",+ "importExport.services.dropboxInstructionsPart1": "Dropbox export instructions part 1",+ "importExport.services.edgeDescription": "Description for Edge import service",+ "importExport.services.edgeInstructionsPart1": "Edge export instructions part 1",+ "importExport.services.enpassDescription": "Description for Enpass import service",+ "importExport.services.enpassInstructionsPart1": "Enpass export instructions part 1",+ "importExport.services.firefoxDescription": "Description for Firefox import service",+ "importExport.services.firefoxInstructionsPart1": "Firefox export instructions part 1",+ "importExport.services.genericCsvDescription": "Description for Generic CSV import service",+ "importExport.services.genericCsvInstructionsPart1": "Generic CSV instructions part 1",+ "importExport.services.genericCsvStep1": "Generic CSV step 1",+ "importExport.services.genericCsvStep2": "Generic CSV step 2",+ "importExport.services.genericCsvStep3": "Generic CSV step 3",+ "importExport.services.genericCsvStep4": "Generic CSV step 4",+ "importExport.services.genericCsvTemplateDownloadError": "Error message for template download failure",+ "importExport.services.keePassDescription": "Description for KeePass import service",+ "importExport.services.keePassInstructionsPart1": "KeePass export instructions part 1",+ "importExport.services.keePassXCDescription": "Description for KeePassXC import service",+ "importExport.services.keePassXCInstructionsPart1": "KeePassXC export instructions part 1",+ "importExport.services.lastPassDescription": "Description for LastPass import service",+ "importExport.services.lastPassInstructionsPart1": "LastPass export instructions part 1",+ "importExport.services.nordPassDescription": "Description for NordPass import service",+ "importExport.services.nordPassInstructionsPart1": "NordPass export instructions part 1",+ "importExport.services.onePasswordDescription": "Description for 1Password import service",+ "importExport.services.onePasswordInstructionsPart1": "1Password export instructions part 1",+ "importExport.services.protonPassDescription": "Description for Proton Pass import service",+ "importExport.services.protonPassInstructionsPart1": "Proton Pass export instructions part 1",+ "importExport.services.roboformDescription": "Description for RoboForm import service",+ "importExport.services.roboformInstructionsPart1": "RoboForm export instructions part 1",+ "importExport.services.strongboxDescription": "Description for Strongbox import service",+ "importExport.services.strongboxInstructionsPart1": "Strongbox export instructions part 1",+ "importExport.services.template": "Link text at the end of \"Download the AliasVault Import CSV\", downloads the CSV template",+ "importExport.services.uploadInstructions": "Common instruction for file upload",+ "items.addEdit.addItemDescription": "Description for adding a new item",+ "items.addEdit.deletePasskeyButton": "Button to delete passkey",+ "items.addEdit.editItemDescription": "Description for editing an existing item",+ "items.addEdit.errorSavingItem": "Error message when saving item fails",+ "items.addEdit.passkeyHelpText": "Help text explaining how passkeys work",+ "items.addEdit.passkeyWillBeDeleted": "Message explaining passkey will be deleted on save",+ "items.addEdit.removeField": "Tooltip for removing a field",+ "items.addEdit.savingVaultMessage": "Loading message when saving vault",+ "items.addEdit.serviceNamePlaceholder": "Placeholder text for service name input",+ "items.addFieldMenu.defaultFieldLabel": "Default label for custom field, {0} is the field number",+ "items.attachmentUnavailable": "Tooltip on an attachment whose file data could not be loaded",+ "items.delete.deleteItemDescription": "Confirmation message shown in the delete-item modal. Placeholder {0} is the trash retention period in days.",+ "items.delete.deleteItemNotFoundError": "Error message when item is not found during deletion",+ "items.delete.deleteSuccessMessage": "Success message after item deletion",+ "items.delete.noCancelButton": "Cancel button text",+ "items.delete.yesImSureButton": "Confirmation button text",+ "items.editableFieldLabel.deleteField": "Tooltip for delete field button",+ "items.editableFieldLabel.editLabel": "Tooltip for edit label button",+ "items.fieldHistory.deleteConfirm": "Delete confirmation text",+ "items.folders.deleteModal.deleteFolderAndContentsDescription": "Description for delete folder and contents option. {0} is item count.",+ "items.folders.deleteModal.deleteFolderAndContentsTitle": "Title for delete folder and contents option",+ "items.folders.deleteModal.deleteFolderDescription": "Description for delete folder modal. {0} is the folder name.",+ "items.folders.modal.folderNamePlaceholder": "Placeholder for folder name input",+ "items.folderSelector.noFolder": "Text shown when no folder is selected",+ "items.folderSelector.noFoldersAvailable": "Message shown when no folders exist",+ "items.hasAttachments": "Screen reader label of the icon shown on items with attachments",+ "items.hasPasskey": "Screen reader label of the icon shown on items with a passkey",+ "items.hasTotp": "Screen reader label of the icon shown on items with a two-factor code",+ "items.home.alphabeticalOption": "Alphabetical sort option",+ "items.home.buttonLocationText": "Text describing button location",+ "items.home.createFirstItemText": "Text explaining how to create first item",+ "items.home.emptyFolderMessage": "Empty state message when folder has no items",+ "items.home.failedToCreateFolder": "Error message when folder creation fails",+ "items.home.failedToDeleteFolder": "Error message when folder deletion fails",+ "items.home.failedToLoadItemsMessage": "Error message when items fail to load",+ "items.home.filteringBy": "Label shown when a filter is active",+ "items.home.gridViewOption": "Grid view option in dropdown",+ "items.home.importButtonText": "Import button text",+ "items.home.importItemsText": "Text explaining import option",+ "items.home.loadingMore": "Text shown when loading more items during infinite scroll",+ "items.home.newAliasButtonText": "Text reference to the New Alias button (desktop)",+ "items.home.newAliasButtonTextMobile": "Text reference to the New Alias button (mobile)",+ "items.home.noItemsTitle": "Title when no items exist",+ "items.home.pageDescription": "Page description text",+ "items.home.sortOrderLabel": "Label for sort order dropdown",+ "items.home.tableViewOption": "Table view option in dropdown",+ "items.home.viewModeLabel": "Label for view mode dropdown",+ "items.passwordSettings": "Title for password settings section",+ "items.passwordSettingsPopup.avoidAmbiguousCharsLabel": "Checkbox label for avoiding ambiguous characters",+ "items.passwordSettingsPopup.includeLowercaseLabel": "Checkbox label for lowercase letters",+ "items.passwordSettingsPopup.includeNumbersLabel": "Checkbox label for numbers",+ "items.passwordSettingsPopup.includeSpecialCharsLabel": "Checkbox label for special characters",+ "items.passwordSettingsPopup.includeUppercaseLabel": "Checkbox label for uppercase letters",+ "items.passwordSettingsPopup.passwordLengthLabel": "Label for password length slider. {0} is placeholder for current length",+ "items.passwordSettingsPopup.previewLabel": "Label for password preview section",+ "items.passwordSettingsPopup.saveGloballyButton": "Button to save settings globally",+ "items.passwordSettingsPopup.settingsUpdatedMessage": "Success message when settings are saved",+ "items.passwordSettingsPopup.useJustOnceButton": "Button to use settings temporarily",+ "items.quickCreate.createItemErrorMessage": "Error message when item creation fails",+ "items.quickCreate.createNewAliasTitle": "Title of the create new alias popup",+ "items.quickCreate.createNewCreditCardTitle": "Title for creating a new credit card item",+ "items.quickCreate.createNewLoginTitle": "Title for creating a new login item",+ "items.quickCreate.createNewNoteTitle": "Title for creating a new note item",+ "items.quickCreate.creatingNewAliasMessage": "Loading message while creating alias",+ "items.quickCreate.namePlaceholderCard": "Placeholder text for card name field",+ "items.quickCreate.namePlaceholderNote": "Placeholder text for note name field",+ "items.quickCreate.newAliasButtonShort": "Short text for the new alias button on mobile",+ "items.quickCreate.newAliasButtonText": "Text for the new item button",+ "items.quickCreate.typeCard": "Credit card item type label (short)",+ "items.quickCreate.typeLogin": "Login item type label",+ "items.search.noResultsFoundMessage": "Message when no search results are found",+ "items.search.searchHelpText": "Help text explaining what can be searched",+ "items.search.searchingForMessage": "Message showing current search term",+ "items.search.searchingMessage": "Message when search is in progress",+ "items.search.searchTooShortMessage": "Message when search term is too short",+ "items.title": "Label for total item count card",+ "items.trash.confirmDeleteMessage": "Message in delete confirmation modal",+ "items.trash.confirmDeleteTitle": "Title for delete confirmation modal",+ "items.trash.confirmEmptyAllMessage": "Message in empty all confirmation modal",+ "items.trash.confirmEmptyAllTitle": "Title for empty all confirmation modal",+ "items.trash.daysRemaining": "Text showing how many days until permanent deletion",+ "items.trash.deleteFailed": "Error message when deletion fails",+ "items.trash.description": "Description text explaining 30-day retention",+ "items.trash.emptyAll": "Button text to permanently delete all items",+ "items.trash.emptyAllPartialFailed": "Error message when some deletions fail",+ "items.trash.noItems": "Title when no deleted items exist",+ "items.trash.pageDescription": "Page description text",+ "items.trash.restoreFailed": "Error message when restore fails",+ "items.trash.restoreSuccess": "Success message after restore",+ "items.view.cardSection": "Section header for credit card details",+ "items.view.generatedItemDescription": "Description for generated item with email support",+ "items.view.itemNotFoundError": "Error message when item is not found",+ "items.view.loginDetailsSection": "Section header for login details",+ "items.view.passkeyHelpText": "Help text explaining how passkeys work",+ "items.view.storedItemDescription": "Description for stored item without email support",+ "items.view.viewItemTitle": "Page header title for viewing an item",+ "items.welcomeTitle": "Title for the welcome step",+ "itemTypes.alias.title": "Alias item type name",+ "itemTypes.creditCard.title": "Credit Card item type name",+ "itemTypes.fieldLabel": "Placeholder text for field label input",+ "itemTypes.fieldTypes.date": "Date field type option",+ "itemTypes.fieldTypes.email": "Email field type option",+ "itemTypes.fieldTypes.hidden": "Hidden field type option",+ "itemTypes.fieldTypes.number": "Number field type option",+ "itemTypes.fieldTypes.password": "Password field type option",+ "itemTypes.fieldTypes.phone": "Phone field type option",+ "itemTypes.fieldTypes.text": "Text field type option",+ "itemTypes.fieldTypes.textArea": "Text area field type option",+ "itemTypes.fieldTypes.url": "URL field type option",+ "itemTypes.login.title": "Login item type name",+ "itemTypes.note.title": "Note item type label",+ "itemTypes.secureNote": "Secure Note item type name",+ "logout.loggingOutDescription": "Description shown during logout process",+ "logout.loggingOutTitle": "Title shown during logout process",+ "navigation.vault": "Main navigation link for vault section",+ "passkeys.passkey": "Label for passkey",+ "passkeys.site": "Label for passkey site/relying party ID",+ "settings.apps.browserExtensionsDescription": "Description for browser extensions",+ "settings.apps.browserExtensionsTitle": "Title for browser extensions section",+ "settings.apps.comingSoonText": "Coming soon text for unavailable extensions",+ "settings.apps.downloadButton": "Download button text",+ "settings.apps.installButton": "Install button text",+ "settings.apps.mobileAppsDescription": "Description for mobile apps",+ "settings.apps.mobileAppsTitle": "Title for mobile apps section",+ "settings.apps.pageDescription": "Page description for extensions and apps",+ "settings.apps.pageTitle": "Page title for extensions and apps",+ "settings.exportConfirmTitle": "Export section title",+ "settings.general.aliasGenerationAgeRangeDescription": "Description for alias generation age range setting",+ "settings.general.aliasGenerationGenderDescription": "Description for alias generation gender setting",+ "settings.general.aliasGenerationLanguageDescription": "Description for alias generation language setting",+ "settings.general.aliasSettingsTitle": "Title for identity generator settings section",+ "settings.general.appLanguageDescription": "Description for app language setting",+ "settings.general.appLanguageTitle": "Title for app language settings section",+ "settings.general.autoEmailRefreshLabel": "Label for auto email refresh setting",+ "settings.general.clipboardClearLimitationNote": "Note explaining limitations of clipboard clearing feature",+ "settings.general.clipboardClearSecondsDescription": "Description for clipboard clear seconds setting",+ "settings.general.clipboardClearSecondsLabel": "Label for clipboard clear seconds setting",+ "settings.general.defaultEmailDomainDescription": "Description for default email domain setting",+ "settings.general.defaultEmailDomainDescriptionNote": "Note for default email domain setting explaining the difference between private and public domains.",+ "settings.general.defaultEmailDomainLabel": "Label for default email domain setting",+ "settings.general.defaultEmailDomainLearnMore": "Link to documentation for default email domain setting",+ "settings.general.emailSettingsTitle": "Title for email settings section",+ "settings.general.pageDescription": "Page description for general settings",+ "settings.general.pageTitle": "Page title for general settings",+ "settings.general.privateDomainsDisabledLabel": "Label for private domains group when no private email domains are configured",+ "settings.general.privateDomainsLabel": "Label for private domains group",+ "settings.general.publicDomainsLabel": "Label for public domains group",+ "settings.importExport": "Page title",+ "settings.passwordGeneratorSettings.configureButton": "Button text to configure settings",+ "settings.passwordGeneratorSettings.passwordGeneratorSettingsLabel": "Label for default password generator settings",+ "settings.resetVault.pageTitle": "Page title",+ "settings.resetVault.resetVaultConfirmButton": "Reset vault final confirmation button",+ "settings.resetVault.resetVaultConfirmUsernameLabel": "Reset vault username confirmation label",+ "settings.resetVault.resetVaultContinueButton": "Reset vault continue button",+ "settings.resetVault.resetVaultDeletionIrreversibleNote": "Reset vault final step irreversible note",+ "settings.resetVault.resetVaultEmailAliasesKeptNote": "Reset vault note about email aliases being kept",+ "settings.resetVault.resetVaultEnterPasswordLabel": "Reset vault password confirmation label",+ "settings.resetVault.resetVaultErrorMessage": "Reset vault error message",+ "settings.resetVault.resetVaultFinalWarning": "Reset vault final warning message",+ "settings.resetVault.resetVaultIrreversibleNote": "Reset vault note about action being irreversible",+ "settings.resetVault.resetVaultItemsDeletedNote": "Reset vault note about items being deleted",+ "settings.resetVault.resetVaultPasswordIncorrect": "Reset vault password incorrect error",+ "settings.resetVault.resetVaultPleaseNote": "Reset vault please note prefix",+ "settings.resetVault.resetVaultProgressMessage": "Reset vault progress message",+ "settings.resetVault.resetVaultSettingsKeptNote": "Reset vault note about settings being kept",+ "settings.resetVault.resetVaultSuccessMessage": "Reset vault success message",+ "settings.resetVault.resetVaultUsernameDoesNotMatch": "Reset vault username mismatch error",+ "settings.resetVault.section.description": "Reset vault section description",+ "settings.securitySettings.activeSessions.actionColumn": "Table column header",+ "settings.securitySettings.activeSessions.noSessionsMessage": "Message when no active sessions are available",+ "settings.securitySettings.activeSessions.revokeExceptionMessage": "Exception message when session revocation fails. {0} is placeholder for error details",+ "settings.securitySettings.activeSessions.revokeSuccessMessage": "Success message when session is revoked",+ "settings.securitySettings.authLogs.deviceColumn": "Table column header",+ "settings.securitySettings.authLogs.eventTypeColumn": "Table column header",+ "settings.securitySettings.authLogs.noLogsMessage": "Message when no auth logs are available",+ "settings.securitySettings.authLogs.timestampColumn": "Table column header",+ "settings.securitySettings.changePassword.changingPasswordMessage": "Loading message displayed while changing password",+ "settings.securitySettings.changePassword.failedToChangePassword": "Error message when password change fails",+ "settings.securitySettings.changePassword.passwordChangedSuccessfully": "Success message after password change",+ "settings.securitySettings.deleteAccount.confirmUsernameLabel": "Label for username confirmation input field",+ "settings.securitySettings.deleteAccount.continueWithAccountDeletion": "Button text to continue with account deletion",+ "settings.securitySettings.deleteAccount.deleteMyAccount": "Button text to delete account",+ "settings.securitySettings.deleteAccount.deletingAccount": "Loading message displayed while deleting account",+ "settings.securitySettings.deleteAccount.deletionIrreversibleNote": "Note about deletion being irreversible",+ "settings.securitySettings.deleteAccount.errorProcessingRequest": "Generic error message for request processing",+ "settings.securitySettings.deleteAccount.finalWarning": "Final warning message before account deletion",+ "settings.securitySettings.deleteAccount.permanentActionWarning": "Warning message about permanent deletion",+ "settings.securitySettings.deleteAccount.usernameMismatchDescription": "Error message when username doesn't match",+ "settings.securitySettings.deleteAccountSection.description": "Warning description for account deletion",+ "settings.securitySettings.disable2fa.confirmDisableButton": "Button text to confirm disabling 2FA",+ "settings.securitySettings.disable2fa.failedToDisable2Fa": "Error message when 2FA disable fails",+ "settings.securitySettings.disable2fa.pageDescription": "Description text explaining what disabling 2FA means",+ "settings.securitySettings.disable2fa.pageTitle": "Page title for the disable 2FA page",+ "settings.securitySettings.disable2fa.statusMessage": "Status message explaining current 2FA state",+ "settings.securitySettings.disable2fa.twoFactorDisabledSuccess": "Success message when 2FA is disabled",+ "settings.securitySettings.disable2fa.twoFactorNotEnabled": "Error message when 2FA is not enabled",+ "settings.securitySettings.disable2fa.warningMessage": "Warning message about the consequences of disabling 2FA",+ "settings.securitySettings.enable2fa.failedToEnable2Fa": "Error message when 2FA setup fails",+ "settings.securitySettings.enable2fa.pageDescription": "Description text explaining 2FA setup",+ "settings.securitySettings.enable2fa.pageTitle": "Page title for the enable 2FA page",+ "settings.securitySettings.enable2fa.qrCodeInstructions": "Instructions for scanning QR code or entering secret",+ "settings.securitySettings.enable2fa.twoFactorEnabledSuccess": "Success message when 2FA is enabled",+ "settings.securitySettings.enable2fa.verificationCodePlaceholder": "Placeholder text for verification code input",+ "settings.securitySettings.enable2fa.verifyAndEnableButton": "Button text to verify and enable 2FA",+ "settings.securitySettings.pageDescription": "Description for the security settings page",+ "settings.securitySettings.pageTitle": "Title for the security settings page",+ "settings.securitySettings.passkeyUnlock.disableButton": "Button to disable passkey unlock",+ "settings.securitySettings.passkeyUnlock.disabledDescription": "Description when passkey unlock is disabled",+ "settings.securitySettings.passkeyUnlock.enableButton": "Button to enable passkey unlock",+ "settings.securitySettings.passkeyUnlock.enabledDescription": "Description when passkey unlock is enabled",+ "settings.securitySettings.passkeyUnlock.enableErrorMessage": "Generic error message when enabling fails",+ "settings.securitySettings.passkeyUnlock.experimentalWarning": "Warning about feature compatibility",+ "settings.securitySettings.passkeyUnlock.successDisabledMessage": "Success message when passkey unlock is disabled",+ "settings.securitySettings.passkeyUnlock.successEnabledMessage": "Success message when passkey unlock is enabled",+ "settings.securitySettings.passkeyUnlock.title": "Title for passkey unlock section",+ "settings.securitySettings.passkeyUnlock.webAuthnNotSupportedError": "Error when WebAuthn is not supported",+ "settings.securitySettings.recoveryCodes.description": "Description of recovery codes",+ "settings.securitySettings.recoveryCodes.title": "Section title",+ "settings.securitySettings.recoveryCodes.warningDescription": "Warning description about recovery codes",+ "settings.securitySettings.recoveryCodes.warningTitle": "Warning title about storing codes",+ "settings.securitySettings.twoFactor.disabledMessage": "Status message when 2FA is disabled",+ "settings.securitySettings.twoFactor.enabledMessage": "Status message when 2FA is enabled",+ "settings.storageInsights.breadcrumbTitle": "Breadcrumb title for storage insights page",+ "settings.storageInsights.breakdownLogosLabel": "Legend label for logos slice",+ "settings.storageInsights.breakdownTitle": "Title for the breakdown bar section",+ "settings.storageInsights.columnCreated": "Table column header for creation date",+ "settings.storageInsights.columnFilename": "Table column header for attachment filename",+ "settings.storageInsights.columnItem": "Table column header for the parent item name",+ "settings.storageInsights.columnItemCount": "Table column header for the number of items using a logo",+ "settings.storageInsights.columnSize": "Table column header for size in KB",+ "settings.storageInsights.countsTitle": "Title for the counts/overview section",+ "settings.storageInsights.deleteAllLogosButton": "Button to delete every logo in the vault",+ "settings.storageInsights.deleteAllLogosConfirmMessage": "Confirmation modal body for delete-all-logos",+ "settings.storageInsights.deleteAllLogosConfirmTitle": "Confirmation modal title for delete-all-logos",+ "settings.storageInsights.deleteAllLogosSuccessMessage": "Success message after deleting all logos, {0} is the number of items",+ "settings.storageInsights.itemsWithAttachmentsLabel": "Label for count of items that have at least one attachment",+ "settings.storageInsights.itemsWithLogosLabel": "Label for count of items that reference a logo",+ "settings.storageInsights.logoManagementDescription": "Description for the logo management section",+ "settings.storageInsights.logoManagementTitle": "Title for the logo management section",+ "settings.storageInsights.pageDescription": "Page description for vault storage insights",+ "settings.storageInsights.pageTitle": "Page title for vault storage insights",+ "settings.storageInsights.redownloadAllLogosButton": "Button to re-fetch favicons for every item with a URL",+ "settings.storageInsights.redownloadAllLogosConfirmMessage": "Confirmation modal body for redownload-all-logos",+ "settings.storageInsights.redownloadAllLogosConfirmTitle": "Confirmation modal title for redownload-all-logos",+ "settings.storageInsights.redownloadAllLogosSuccessMessage": "Success message after re-downloading all logos, {0} is the number of items",+ "settings.storageInsights.topAttachmentsDescription": "Description for the top attachments table",+ "settings.storageInsights.topAttachmentsTitle": "Title for the top attachments table",+ "settings.storageInsights.topLogosDescription": "Description for the top logos table",+ "settings.storageInsights.topLogosTitle": "Title for the top logos table",+ "sync.decryptError.errorDescription": "Description for vault decryption error",+ "sync.decryptError.errorTitle": "Title for vault decryption error",+ "sync.decrypting.description": "Description for vault decryption progress",+ "sync.decrypting.title": "Title for vault decryption progress",+ "sync.page.pageTitle": "Page title for the sync page",+ "totp.addTotpCodeDescription": "Description for adding TOTP codes",+ "totp.addTotpCodeModalTitle": "Modal title for adding TOTP code",+ "totp.closeFormButton": "Button to close the add TOTP form",+ "totp.deleteCodeConfirmation": "Confirmation message for deleting TOTP code",+ "totp.deleteCodeTitle": "Title for delete TOTP code action",+ "totp.secretKeyPlaceholder": "Placeholder text for secret key input",+ "totp.totpInstructions": "Instructions for adding TOTP codes",+ "totp.viewer.noTotpCodesMessage": "Message shown when no TOTP codes are configured",+ "upgrade.noDescriptionAvailable": "Fallback text when version description is not available",+ "upgrade.startUpgradeButton": "Button text to start the upgrade process",+ "upgrade.upgradeDescription": "Description of vault upgrade process",+ "upgrade.upgradeFailedError": "Error message when upgrade fails",+ "upgrade.upgradeRequiredDescription": "Description of upgrade requirements with changes placeholder",+ "upgrade.upgradeSuccessMessage": "Success message after successful vault upgrade",+ "validation.passwordRequired": "Error message when password is required",+ "validation.secretKeyRequired": "Error message when secret key is required",+ "validation.serviceNameRequired": "Error message when service name is required",+ "web.footer.copyrightText": "Copyright text in footer",+ "web.footer.tipCreateShortcut": "Tip about keyboard shortcut for creating aliases",+ "web.footer.tipFindShortcut": "Tip about keyboard shortcut for search",+ "web.footer.tipHomeShortcut": "Tip about keyboard shortcut for home",+ "web.footer.tipLockShortcut": "Tip about keyboard shortcut for locking vault",+ "web.topMenu.betaLabel": "Label indicating beta version of the application",+ "web.topMenu.enableDarkMode": "Button text for switching to dark theme",+ "web.topMenu.enableLightMode": "Button text for switching to light theme",+ "web.topMenu.logOut": "Button text for logging out",+ "web.topMenu.openMenuLabel": "Screen reader label for mobile menu button",+ "web.welcome.createFirstIdentityButton": "Button text for creating first identity",+ "web.welcome.extensionsAppsTipContent": "Content for browser extensions and mobile apps tip",+ "web.welcome.extensionsAppsTipTitle": "Title for browser extensions and mobile apps tip",+ "web.welcome.finishingTutorialMessage": "Loading message when finishing tutorial",+ "web.welcome.getStartedButton": "Get started button text",+ "web.welcome.howAliasVaultWorksStepTitle": "Title for the how it works step",+ "web.welcome.howItWorksIntro": "Introduction text for how it works step",+ "web.welcome.howItWorksStep1": "First step in how it works explanation",+ "web.welcome.howItWorksStep2": "Second step in how it works explanation",+ "web.welcome.howItWorksStep3": "Third step in how it works explanation",+ "web.welcome.howItWorksStep4": "Fourth step in how it works explanation",+ "web.welcome.masterPasswordTipContent": "Content for master password tip",+ "web.welcome.masterPasswordTipTitle": "Title for master password tip",+ "web.welcome.readyToStartMessage": "Message encouraging user to create first identity",+ "web.welcome.readyToStartTitle": "Title for ready to start section",+ "web.welcome.soonSuffix": "Suffix indicating feature coming soon",+ "web.welcome.tipsStepTitle": "Title for the tips step",+ "web.welcome.tutorialStepTitle": "Default tutorial step title",+ "web.welcome.twoFactorTipContent": "Content for two-factor authentication tip",+ "web.welcome.twoFactorTipTitle": "Title for two-factor authentication tip",+ "web.welcome.welcomeMessage": "Welcome message on the first tutorial step"+}diff --git a/core/i18n/scripts/export-native.mjs b/core/i18n/scripts/export-native.mjsnew file mode 100644index 000000000..838615052--- /dev/null+++ b/core/i18n/scripts/export-native.mjs@@ -0,0 +1,126 @@+#!/usr/bin/env node+/*+ * Generates the native translation files of the mobile app (iOS .strings, Android strings.xml) from the shared+ * translations in core/i18n/locales, using the map in core/i18n/exports/mobile-native.json.+ *+ * node core/i18n/scripts/export-native.mjs # write the files+ * node core/i18n/scripts/export-native.mjs --check # exit 1 when a generated file is out of date+ *+ * Languages are the UI languages of LANGUAGE_CODES in src/index.ts. A missing translation falls back to English.+ */++import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';++const I18N_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');+const REPO_ROOT = path.resolve(I18N_DIR, '../..');+const CHECK = process.argv.includes('--check');+const GENERATED_NOTE = 'Generated from core/i18n/locales by core/i18n/scripts/export-native.mjs. Do not edit, change core/i18n instead.';++const codesMatch = /LANGUAGE_CODES = \[([^\]]+)\]/.exec(readFileSync(path.join(I18N_DIR, 'src/index.ts'), 'utf8'));+if (!codesMatch) {+ throw new Error('LANGUAGE_CODES not found in src/index.ts');+}+const languages = [...codesMatch[1].matchAll(/'([a-z]{2})'/g)].map((m) => m[1]);+const { targets } = JSON.parse(readFileSync(path.join(I18N_DIR, 'exports/mobile-native.json'), 'utf8'));+const locales = Object.fromEntries(languages.map((lang) => [lang, JSON.parse(readFileSync(path.join(I18N_DIR, `locales/${lang}.json`), 'utf8'))]));++/**+ * Read a dotted key from a translation tree.+ * @param {Record<string, unknown>} tree+ * @param {string} key+ */+const lookup = (tree, key) => key.split('.').reduce((node, segment) => (node && typeof node === 'object' ? node[segment] : undefined), tree);++/**+ * The text of a shared key in a language (English fallback), with its placeholders in the native format.+ * @param {string} lang+ * @param {string | { key: string, format?: Record<string, string> }} spec+ * @param {string} platform+ * @param {string} where - used in error messages+ */+function resolve(lang, spec, platform, where) {+ const { key, format = {} } = typeof spec === 'string' ? { key: spec } : spec;+ const english = lookup(locales.en, key);+ if (typeof english !== 'string') {+ throw new Error(`${where}: shared key "${key}" does not exist in en.json`);+ }+ const translated = lookup(locales[lang], key);+ let text = typeof translated === 'string' && translated.length > 0 ? translated : english;+ for (const [name, specifier] of Object.entries(format)) {+ text = text.split(`{{${name}}}`).join(specifier);+ }+ /* iOS code replaces the remaining {{name}} placeholders itself; Android only knows format specifiers. */+ if (platform === 'android' && /\{\{\w+\}\}/.test(text)) {+ throw new Error(`${where}: "${key}" has a placeholder without an Android format specifier`);+ }+ return text;+}++/**+ * Escape a value for an Apple .strings file.+ * @param {string} value+ */+const escapeStrings = (value) => value.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n');++/**+ * Escape a value for an Android string resource.+ * @param {string} value+ */+const escapeAndroid = (value) => value+ .replace(/\\/g, '\\\\')+ .replace(/&/g, '&')+ .replace(/</g, '<')+ .replace(/>/g, '>')+ .replace(/'/g, "\\'")+ .replace(/"/g, '\\"')+ .replace(/\n/g, '\\n')+ .replace(/^([@?])/, '\\$1');++/**+ * Render one native file.+ * @param {Record<string, any>} target+ * @param {string} lang+ */+function render(target, lang) {+ const entries = Object.entries(target.strings).map(([nativeKey, spec]) => [nativeKey, resolve(lang, spec, target.platform, `${target.path} ${nativeKey}`)]);+ if (target.platform === 'ios') {+ const lines = [`/* ${target.comment}. ${GENERATED_NOTE} */`, ...entries.map(([k, v]) => `"${escapeStrings(k)}" = "${escapeStrings(v)}";`)];+ return `${lines.join('\n')}\n`;+ }+ const constants = lang === 'en' ? Object.entries(target.constants ?? {}).map(([k, v]) => ` <string name="${k}" translatable="false">${escapeAndroid(v)}</string>`) : [];+ const strings = entries.map(([k, v]) => ` <string name="${k}">${escapeAndroid(v)}</string>`);+ return `<?xml version="1.0" encoding="utf-8"?>\n<!-- ${target.comment}. ${GENERATED_NOTE} -->\n<resources>\n${[...constants, ...strings].join('\n')}\n</resources>\n`;+}++const stale = [];+let written = 0;+for (const target of targets) {+ for (const lang of languages) {+ const relative = target.path.replace('{lang}', lang).replace('{-lang}', lang === 'en' ? '' : `-${lang}`);+ const file = path.join(REPO_ROOT, relative);+ const content = render(target, lang);+ const current = existsSync(file) ? readFileSync(file) : undefined;+ if (current && current.equals(Buffer.from(content, 'utf8'))) {+ continue;+ }+ if (CHECK) {+ stale.push(relative);+ continue;+ }+ mkdirSync(path.dirname(file), { recursive: true });+ writeFileSync(file, content);+ written++;+ }+}++if (CHECK) {+ if (stale.length > 0) {+ console.error(`Native translation files are out of date, run "node core/i18n/scripts/export-native.mjs":\n${stale.join('\n')}`);+ process.exit(1);+ }+ console.info('Native translation files are up to date.');+} else {+ console.info(`Wrote ${written} native translation file(s).`);+}diff --git a/core/i18n/scripts/sync-hints.mjs b/core/i18n/scripts/sync-hints.mjsnew file mode 100644index 000000000..1c9f1c136--- /dev/null+++ b/core/i18n/scripts/sync-hints.mjs@@ -0,0 +1,88 @@+#!/usr/bin/env node+/*+ * Copies the translator hints of core/i18n/hints.json into the context field of the matching Crowdin strings.+ * Only strings whose context differs are updated, so running it again is cheap.+ *+ * Environment: CROWDIN_PROJECT_ID, CROWDIN_PERSONAL_TOKEN. Pass --dry-run to only print the changes.+ * node core/i18n/scripts/sync-hints.mjs [--dry-run]+ */++import { readFileSync } from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';++const SOURCE_FILE = '/core/i18n/locales/en.json';+const API = 'https://api.crowdin.com/api/v2';+const projectId = process.env.CROWDIN_PROJECT_ID;+const token = process.env.CROWDIN_PERSONAL_TOKEN;+const dryRun = process.argv.includes('--dry-run');++if (!projectId || !token) {+ console.error('CROWDIN_PROJECT_ID and CROWDIN_PERSONAL_TOKEN must be set.');+ process.exit(1);+}++const hints = JSON.parse(readFileSync(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../hints.json'), 'utf8'));++/**+ * Call the Crowdin API.+ * @param {string} method+ * @param {string} url+ * @param {unknown} [body]+ */+async function crowdin(method, url, body) {+ const response = await fetch(`${API}${url}`, {+ method,+ headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' },+ body: body === undefined ? undefined : JSON.stringify(body),+ });+ if (!response.ok) {+ throw new Error(`${method} ${url} failed: ${response.status} ${await response.text()}`);+ }+ return response.json();+}++/**+ * Fetch every page of a Crowdin list endpoint.+ * @param {string} url+ */+async function listAll(url) {+ const items = [];+ for (let offset = 0; ; offset += 500) {+ const page = await crowdin('GET', `${url}${url.includes('?') ? '&' : '?'}limit=500&offset=${offset}`);+ items.push(...page.data.map((entry) => entry.data));+ if (page.data.length < 500) return items;+ }+}++const file = (await listAll(`/projects/${projectId}/files`)).find((f) => f.path === SOURCE_FILE);+if (!file) {+ throw new Error(`${SOURCE_FILE} is not a source file of the Crowdin project (yet).`);+}++/* Crowdin shows nested JSON keys as "a.b" or "a -> b" depending on the parser; accept both. */+const keyOf = (identifier) => identifier.replace(/\s*->\s*/g, '.');+let updated = 0;+let unchanged = 0;+const found = new Set();+for (const string of await listAll(`/projects/${projectId}/strings?fileId=${file.id}`)) {+ const key = keyOf(string.identifier);+ const hint = hints[key];+ if (hint === undefined) continue;+ found.add(key);+ if ((string.context ?? '').trim() === hint) {+ unchanged++;+ continue;+ }+ console.info(`${key}: ${hint}`);+ if (!dryRun) {+ await crowdin('PATCH', `/projects/${projectId}/strings/${string.id}`, [{ op: 'replace', path: '/context', value: hint }]);+ }+ updated++;+}++const missing = Object.keys(hints).filter((key) => !found.has(key));+console.info(`${dryRun ? 'Would update' : 'Updated'} ${updated}, unchanged ${unchanged}, hints without a Crowdin string ${missing.length}.`);+if (missing.length > 0) {+ console.info(`Not found in Crowdin (not uploaded yet, or a stale hint): ${missing.join(', ')}`);+}