diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json index ef2a5f2e8..7b8591530 100644 --- a/src/lib/locales/en.json +++ b/src/lib/locales/en.json @@ -63,14 +63,20 @@ "type": "Type", "html_url": "HTML URL", "api_url": "API URL", - "organization": "Organization" + "organization": "Organization", + "new_password": "New password", + "super_secure_new_password": "Super secure new password", + "submit": "Submit" }, "register": { "register": "Register", "first_user": "You are registering the first user. It will be the administrator of your Coolify instance." }, "reset": { - "reset_password": "Reset password" + "reset_password": "Reset", + "invalid_secret_key": "Invalid secret key.", + "secret_key": "Secret Key", + "find_path_secret_key": "You can find it in ~/coolify/.env (COOLIFY_SECRET_KEY)" }, "application": { "configuration": { diff --git a/src/routes/reset/index.json.ts b/src/routes/reset/index.json.ts index a75ea4766..1eddbd82b 100644 --- a/src/routes/reset/index.json.ts +++ b/src/routes/reset/index.json.ts @@ -1,5 +1,6 @@ import type { RequestHandler } from '@sveltejs/kit'; import * as db from '$lib/database'; +import { t } from '$lib/translations'; export const get: RequestHandler = async () => { const users = await db.prisma.user.findMany({}); @@ -16,7 +17,7 @@ export const post: RequestHandler = async (event) => { return { status: 500, body: { - error: 'Invalid secret key.' + error: t.get('reset.invalid_secret_key') } }; } diff --git a/src/routes/reset/index.svelte b/src/routes/reset/index.svelte index 498c63e64..acb042c8f 100644 --- a/src/routes/reset/index.svelte +++ b/src/routes/reset/index.svelte @@ -3,6 +3,7 @@ import { get, post } from '$lib/api'; import CopyPasswordField from '$lib/components/CopyPasswordField.svelte'; import { errorNotification } from '$lib/form'; + import { t } from '$lib/translations'; import { toast } from '@zerodevx/svelte-toast'; let secretKey; @@ -48,14 +49,14 @@ -
Reset Password
+
{$t('reset.reset_password')}
{#if password} - - + + @@ -67,11 +68,11 @@ id="newPassword" name="newPassword" bind:value={user.newPassword} - placeholder="Super secure new password" + placeholder={$t('forms.super_secure_new_password')} /> resetPassword(user)}>{$t('reset.reset_password')} @@ -80,16 +81,16 @@
EmailNew password{$t('forms.email')}{$t('forms.new_password')}
{:else}
-
Secret Key
+
{$t('reset.secret_key')}
{$t('forms.submit')} {/if} diff --git a/src/routes/reset/password.json.ts b/src/routes/reset/password.json.ts index 28e9d56e3..103d07ff3 100644 --- a/src/routes/reset/password.json.ts +++ b/src/routes/reset/password.json.ts @@ -1,6 +1,7 @@ import type { RequestHandler } from '@sveltejs/kit'; import * as db from '$lib/database'; import { ErrorHandler, hashPassword } from '$lib/database'; +import { t } from '$lib/translations'; export const post: RequestHandler = async (event) => { const { secretKey, user } = await event.request.json(); @@ -8,7 +9,7 @@ export const post: RequestHandler = async (event) => { return { status: 500, body: { - error: 'Invalid secret key.' + error: t.get('reset.invalid_secret_key') } }; }