Cleanup browser extension translations to use new item.* based keys (#1468)

This commit is contained in:
Leendert de Borst
2026-01-21 11:26:21 +01:00
committed by Leendert de Borst
parent a14142a45a
commit 7bad4a6a5f
9 changed files with 48 additions and 50 deletions

View File

@@ -862,8 +862,8 @@ export async function createAliasCreationPopup(suggestedNames: string[], rootCon
const generateNewPasswordText = await t('content.generateNewPassword');
const togglePasswordVisibilityText = await t('content.togglePasswordVisibility');
const createAndSaveCredentialText = await t('content.createAndSaveCredential');
const passwordLengthText = await t('credentials.passwordLength');
const changePasswordComplexityText = await t('credentials.changePasswordComplexity');
const passwordLengthText = await t('items.passwordLength');
const changePasswordComplexityText = await t('items.changePasswordComplexity');
const suggestedNamesHtml = await getSuggestedNamesHtml(suggestedNames, suggestedNames[0] ?? '');
@@ -1278,13 +1278,13 @@ export async function createAliasCreationPopup(suggestedNames: string[], rootCon
*/
const showPasswordConfigDialog = async (): Promise<void> => {
// Get all translations first
const changePasswordComplexityText = await t('credentials.changePasswordComplexity');
const generateNewPreviewText = await t('credentials.generateNewPreview');
const includeLowercaseText = await t('credentials.includeLowercase');
const includeUppercaseText = await t('credentials.includeUppercase');
const includeNumbersText = await t('credentials.includeNumbers');
const includeSpecialCharsText = await t('credentials.includeSpecialChars');
const avoidAmbiguousCharsText = await t('credentials.avoidAmbiguousChars');
const changePasswordComplexityText = await t('items.changePasswordComplexity');
const generateNewPreviewText = await t('items.generateNewPreview');
const includeLowercaseText = await t('items.includeLowercase');
const includeUppercaseText = await t('items.includeUppercase');
const includeNumbersText = await t('items.includeNumbers');
const includeSpecialCharsText = await t('items.includeSpecialChars');
const avoidAmbiguousCharsText = await t('items.avoidAmbiguousChars');
const useText = await t('common.use');
// Create dialog overlay

View File

@@ -67,7 +67,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
<ModalWrapper
isOpen={isOpen}
onClose={onClose}
title={t('credentials.changePasswordComplexity')}
title={t('items.changePasswordComplexity')}
maxWidth="max-w-lg"
footer={
<div className="flex justify-end">
@@ -98,7 +98,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
type="button"
onClick={handleRefreshPreview}
className="px-3 py-2 text-sm text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-lg dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('credentials.generateNewPreview')}
title={t('items.generateNewPreview')}
>
<svg className="w-4 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path>
@@ -119,7 +119,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
? 'bg-primary-600 text-white hover:bg-primary-700'
: 'bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600'
}`}
title={t('credentials.includeLowercase')}
title={t('items.includeLowercase')}
>
<span className="font-mono text-base">a-z</span>
</button>
@@ -133,7 +133,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
? 'bg-primary-600 text-white hover:bg-primary-700'
: 'bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600'
}`}
title={t('credentials.includeUppercase')}
title={t('items.includeUppercase')}
>
<span className="font-mono text-base">A-Z</span>
</button>
@@ -147,7 +147,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
? 'bg-primary-600 text-white hover:bg-primary-700'
: 'bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600'
}`}
title={t('credentials.includeNumbers')}
title={t('items.includeNumbers')}
>
<span className="font-mono text-base">0-9</span>
</button>
@@ -161,7 +161,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
? 'bg-primary-600 text-white hover:bg-primary-700'
: 'bg-gray-200 text-gray-700 hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600'
}`}
title={t('credentials.includeSpecialChars')}
title={t('items.includeSpecialChars')}
>
<span className="font-mono text-base">!@#</span>
</button>
@@ -177,7 +177,7 @@ const PasswordConfigDialog: React.FC<IPasswordConfigDialogProps> = ({
className="h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded dark:bg-gray-700 dark:border-gray-600"
/>
<label htmlFor="use-non-ambiguous" className="ml-2 text-sm text-gray-700 dark:text-gray-300">
{t('credentials.avoidAmbiguousChars')}
{t('items.avoidAmbiguousChars')}
</label>
</div>
</div>

View File

@@ -359,10 +359,10 @@ const EmailDomainField: React.FC<EmailDomainFieldProps> = ({
{showPrivateDomains && (
<div className="mb-4">
<h4 className="text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2">
{t('credentials.privateEmailTitle')} <span className="text-gray-500 dark:text-gray-400">({t('credentials.privateEmailAliasVaultServer')})</span>
{t('items.privateEmailTitle')} <span className="text-gray-500 dark:text-gray-400">({t('items.privateEmailAliasVaultServer')})</span>
</h4>
<p className="text-gray-500 dark:text-gray-400 mb-3">
{t('credentials.privateEmailDescription')}
{t('items.privateEmailDescription')}
</p>
<div className="flex flex-wrap gap-2">
{privateEmailDomains
@@ -387,10 +387,10 @@ const EmailDomainField: React.FC<EmailDomainFieldProps> = ({
<div className={showPrivateDomains ? 'border-t border-gray-200 dark:border-gray-600 pt-4' : ''}>
<h4 className="text-sm font-semibold text-gray-700 dark:text-gray-300 mb-2">
{t('credentials.publicEmailTitle')}
{t('items.publicEmailTitle')}
</h4>
<p className="text-xs text-gray-500 dark:text-gray-400 mb-3">
{t('credentials.publicEmailDescription')}
{t('items.publicEmailDescription')}
</p>
<div className="flex flex-wrap gap-2">
{publicEmailDomains.map((domain) => (

View File

@@ -174,7 +174,7 @@ const PasswordField: React.FC<IPasswordFieldProps> = ({
type="button"
onClick={handleRegeneratePassword}
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm border-l border-gray-300 dark:border-gray-700 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('credentials.generateRandomPassword')}
title={t('items.generateRandomPassword')}
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
@@ -187,7 +187,7 @@ const PasswordField: React.FC<IPasswordFieldProps> = ({
<div className="pt-2">
<div className="flex items-center justify-between mb-2">
<label htmlFor={`${id}-length`} className="text-sm font-medium text-gray-700 dark:text-gray-300">
{t('credentials.passwordLength')}
{t('items.passwordLength')}
</label>
<div className="flex items-center gap-2">
<span className="text-sm text-gray-600 dark:text-gray-400 font-mono">
@@ -197,7 +197,7 @@ const PasswordField: React.FC<IPasswordFieldProps> = ({
type="button"
onClick={openConfigDialog}
className="text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"
title={t('credentials.changePasswordComplexity')}
title={t('items.changePasswordComplexity')}
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />

View File

@@ -58,7 +58,7 @@ const UsernameField: React.FC<IUsernameFieldProps> = ({
type="button"
onClick={handleRegenerate}
className="px-3 text-gray-500 dark:text-white bg-gray-200 hover:bg-gray-300 focus:ring-4 focus:outline-none focus:ring-gray-300 font-medium rounded-r-lg text-sm dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800"
title={t('credentials.generateRandomUsername')}
title={t('items.generateRandomUsername')}
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />

View File

@@ -112,7 +112,7 @@ const TotpEditor: React.FC<TotpEditorProps> = ({
// Validate required fields
if (!formData.secretKey) {
setFormError(t('credentials.validation.required'));
setFormError(t('items.validation.required'));
return;
}

View File

@@ -1142,7 +1142,7 @@ const ItemAddEdit: React.FC = () => {
type="button"
onClick={handleGenerateAlias}
className="p-1.5 text-gray-400 hover:text-primary-500 focus:outline-none"
title={t('credentials.generateRandomAlias')}
title={t('items.generateRandomAlias')}
>
<svg className='w-4 h-4' viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M23 4v6h-6"/>

View File

@@ -269,7 +269,7 @@ const ItemDetails: React.FC = (): React.ReactElement => {
{item.Tags && item.Tags.length > 0 && (
<div className="bg-gray-50 dark:bg-gray-800 rounded-lg p-4">
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{t('credentials.tags')}
{t('items.tags')}
</label>
<div className="flex flex-wrap gap-2">
{item.Tags.map((tag) => (

View File

@@ -167,28 +167,6 @@
"vaultUpgradeRequired": "Vault upgrade required.",
"dismissPopup": "Dismiss popup"
},
"credentials": {
"changePasswordComplexity": "Change password complexity",
"passwordLength": "Password length",
"includeLowercase": "Include lowercase letters",
"includeUppercase": "Include uppercase letters",
"includeNumbers": "Include numbers",
"includeSpecialChars": "Include special characters",
"avoidAmbiguousChars": "Avoid ambiguous characters (o, 0, etc.)",
"privateEmailTitle": "Private Email",
"privateEmailAliasVaultServer": "AliasVault server",
"privateEmailDescription": "E2E encrypted, fully private.",
"publicEmailTitle": "Public Temp Email Providers",
"publicEmailDescription": "Anonymous but limited privacy. Email content is readable by anyone that knows the address.",
"generateRandomUsername": "Generate random username",
"generateRandomPassword": "Generate random password",
"generateNewPreview": "Generate new preview",
"generateRandomAlias": "Generate Random Alias",
"validation": {
"required": "This field is required"
},
"tags": "Tags"
},
"items": {
"title": "Items",
"itemName": "Name",
@@ -226,7 +204,27 @@
"deleteItemConfirm": "Are you sure you want to delete this item?",
"viewHistory": "View history",
"history": "History",
"noHistoryAvailable": "No history available"
"noHistoryAvailable": "No history available",
"tags": "Tags",
"changePasswordComplexity": "Change password complexity",
"passwordLength": "Password length",
"includeLowercase": "Include lowercase letters",
"includeUppercase": "Include uppercase letters",
"includeNumbers": "Include numbers",
"includeSpecialChars": "Include special characters",
"avoidAmbiguousChars": "Avoid ambiguous characters (o, 0, etc.)",
"privateEmailTitle": "Private Email",
"privateEmailAliasVaultServer": "AliasVault server",
"privateEmailDescription": "E2E encrypted, fully private.",
"publicEmailTitle": "Public Temp Email Providers",
"publicEmailDescription": "Anonymous but limited privacy. Email content is readable by anyone that knows the address.",
"generateRandomUsername": "Generate random username",
"generateRandomPassword": "Generate random password",
"generateNewPreview": "Generate new preview",
"generateRandomAlias": "Generate Random Alias",
"validation": {
"required": "This field is required"
}
},
"itemTypes": {
"selectType": "Add New Item",