Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Add reset i18n

Restray13891110ce1d
diff --git a/src/lib/locales/en.json b/src/lib/locales/en.json
index ef2a5f2e8c..7b8591530d 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 a75ea4766f..1eddbd82b3 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 498c63e64d..acb042c8fc 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 @@
<line x1="5" y1="12" x2="11" y2="6" />
</svg>
</div>
-<div class="pb-10 pt-24 text-center text-4xl font-bold">Reset Password</div>
+<div class="pb-10 pt-24 text-center text-4xl font-bold">{$t('reset.reset_password')}</div>
<div class="flex items-center justify-center">
{#if password}
<table class="mx-2 text-left">
<thead class="mb-2">
<tr>
- <th class="px-2">Email</th>
- <th>New password</th>
+ <th class="px-2">{$t('forms.email')}</th>
+ <th>{$t('forms.new_password')}</th>
</tr>
</thead>
<tbody>
@@ -67,11 +68,11 @@
id="newPassword"
name="newPassword"
bind:value={user.newPassword}
- placeholder="Super secure new password"
+ placeholder={$t('forms.super_secure_new_password')}
/>
<button
class="mx-auto my-4 w-32 bg-coollabs hover:bg-coollabs-100"
- on:click={() => resetPassword(user)}>Reset</button
+ on:click={() => resetPassword(user)}>{$t('reset.reset_password')}</button
></td
>
</tr>
@@ -80,16 +81,16 @@
</table>
{:else}
<form class="flex flex-col" on:submit|preventDefault={handleSubmit}>
- <div class="text-center text-2xl py-2 font-bold">Secret Key</div>
+ <div class="text-center text-2xl py-2 font-bold">{$t('reset.secret_key')}</div>
<CopyPasswordField
isPasswordField={true}
id="secretKey"
name="secretKey"
bind:value={secretKey}
- placeholder="You can find it in ~/coolify/.env (COOLIFY_SECRET_KEY)"
+ placeholder={$t('reset.find_path_secret_key')}
/>
<button type="submit" class="bg-coollabs hover:bg-coollabs-100 mx-auto w-32 my-4"
- >Submit</button
+ >{$t('forms.submit')}</button
>
</form>
{/if}
diff --git a/src/routes/reset/password.json.ts b/src/routes/reset/password.json.ts
index 28e9d56e34..103d07ff3a 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')
}
};
}