diff --git a/locales/en-US/instance.json b/locales/en-US/instance.json
index 2060c861..b1c37ad3 100644
--- a/locales/en-US/instance.json
+++ b/locales/en-US/instance.json
@@ -7,10 +7,23 @@
"allFailed": "Failed to import any accounts",
"someFailed": "Imported {{count}} accounts, failed to import {{failed}} accounts",
"noneFailed": "{{count}} accounts imported!",
- "error": "Failed to import accounts"
+ "error": "Failed to import accounts",
+ "noAccounts": "No accounts to import"
},
"unknownError": "Unknown error",
"deviceCodeImportToast": {
+ "loading": "Importing account...",
+ "success": "Account imported!",
+ "error": "Failed to import account"
+ },
+ "import": {
+ "javaEdition": "Java Edition",
+ "bedrockEdition": "Bedrock Edition",
+ "offline": "Offline",
+ "microsoftCredentials": "Microsoft Credentials",
+ "microsoftDeviceCode": "Microsoft Device Code",
+ "microsoftRefreshToken": "Microsoft Refresh Token",
+ "theAltening": "The Altening"
}
}
}
diff --git a/src/components/dialog/import-dialog.tsx b/src/components/dialog/import-dialog.tsx
index 1883f8e4..3cc0f546 100644
--- a/src/components/dialog/import-dialog.tsx
+++ b/src/components/dialog/import-dialog.tsx
@@ -290,7 +290,7 @@ function TextInput(
>
diff --git a/src/routes/dashboard/_layout/instance/$instance/accounts.tsx b/src/routes/dashboard/_layout/instance/$instance/accounts.tsx
index 6d2873b7..37a9140d 100644
--- a/src/routes/dashboard/_layout/instance/$instance/accounts.tsx
+++ b/src/routes/dashboard/_layout/instance/$instance/accounts.tsx
@@ -17,7 +17,6 @@ import {
MinecraftAccountProto_AccountTypeProto,
} from '@/generated/soulfire/common.ts';
import { PlusIcon, TrashIcon } from 'lucide-react';
-import { Checkbox } from '@/components/ui/checkbox.tsx';
import {
DropdownMenu,
DropdownMenuContent,
@@ -108,7 +107,7 @@ function ExtraHeader(props: { table: ReactTable }) {
if (accountTypeCredentialsSelected === null) return;
if (text.length === 0) {
- toast.error('No accounts to import');
+ toast.error(t('account.listImportToast.noAccounts'));
return;
}
@@ -172,6 +171,7 @@ function ExtraHeader(props: { table: ReactTable }) {
instanceInfo.id,
profile,
setProfileMutation,
+ t,
transport,
],
);
@@ -211,7 +211,7 @@ function ExtraHeader(props: { table: ReactTable }) {
if (e instanceof Error) {
reject(e);
} else {
- reject(new Error('Unknown error'));
+ reject(new Error(t('account.unknownError')));
}
}
});
@@ -222,16 +222,16 @@ function ExtraHeader(props: { table: ReactTable }) {
});
})(),
{
- loading: 'Importing account...',
- success: 'Account imported!',
+ loading: t('account.deviceCodeImportToast.loading'),
+ success: t('account.deviceCodeImportToast.success'),
error: (e) => {
console.error(e);
- return 'Failed to import accounts';
+ return t('account.deviceCodeImportToast.error');
},
},
);
},
- [instanceInfo.id, profile, setProfileMutation, transport],
+ [instanceInfo.id, profile, setProfileMutation, t, transport],
);
return (
@@ -243,14 +243,16 @@ function ExtraHeader(props: { table: ReactTable }) {
- Java Edition
+
+ {t('account.import.javaEdition')}
+
setAccountTypeCredentialsSelected(AccountTypeCredentials.OFFLINE)
}
>
- Offline
+ {t('account.import.offline')}
@@ -259,7 +261,7 @@ function ExtraHeader(props: { table: ReactTable }) {
)
}
>
- Microsoft Credentials
+ {t('account.import.microsoftCredentials')}
@@ -268,7 +270,7 @@ function ExtraHeader(props: { table: ReactTable }) {
)
}
>
- Microsoft Device Code
+ {t('account.import.microsoftDeviceCode')}
@@ -277,7 +279,7 @@ function ExtraHeader(props: { table: ReactTable }) {
)
}
>
- Microsoft Refresh Token
+ {t('account.import.microsoftRefreshToken')}
@@ -286,17 +288,19 @@ function ExtraHeader(props: { table: ReactTable }) {
)
}
>
- The Altening
+ {t('account.import.theAltening')}
- Bedrock Edition
+
+ {t('account.import.bedrockEdition')}
+
setAccountTypeCredentialsSelected(AccountTypeCredentials.OFFLINE)
}
>
- Offline
+ {t('account.import.offline')}
@@ -305,7 +309,7 @@ function ExtraHeader(props: { table: ReactTable }) {
)
}
>
- Microsoft Credentials
+ {t('account.import.microsoftCredentials')}
@@ -314,7 +318,7 @@ function ExtraHeader(props: { table: ReactTable }) {
)
}
>
- Microsoft Device Code
+ {t('account.import.microsoftDeviceCode')}
diff --git a/src/routes/dashboard/_layout/instance/$instance/proxies.tsx b/src/routes/dashboard/_layout/instance/$instance/proxies.tsx
index f3653cd5..a56b3225 100644
--- a/src/routes/dashboard/_layout/instance/$instance/proxies.tsx
+++ b/src/routes/dashboard/_layout/instance/$instance/proxies.tsx
@@ -93,7 +93,7 @@ function parseRawTypeToProto(rawType: string): ProxyProto_Type {
case 'socks5':
return ProxyProto_Type.SOCKS5;
default:
- throw new Error('Invalid proxy type');
+ throw new Error('Invalid proxy type ' + rawType);
}
}
@@ -136,6 +136,7 @@ const columns: ColumnDef[] = [
];
function ExtraHeader(props: { table: ReactTable }) {
+ const { t } = useTranslation('instance');
const queryClient = useQueryClient();
const profile = useContext(ProfileContext);
const transport = useContext(TransportContext);