use i18n for page text
This commit is contained in:
parent
5c4b717c28
commit
b62bc0ca46
6 changed files with 23 additions and 14 deletions
|
|
@ -13,5 +13,9 @@
|
||||||
"login_error_email_incorrect": "Email is incorrect",
|
"login_error_email_incorrect": "Email is incorrect",
|
||||||
"login_error_password_incorrect": "Password is incorrect",
|
"login_error_password_incorrect": "Password is incorrect",
|
||||||
"login_error_email_inuse": "Email is already in use",
|
"login_error_email_inuse": "Email is already in use",
|
||||||
"login_error_user_not_found": "The user could not be found"
|
"login_error_user_not_found": "The user could not be found",
|
||||||
|
"sms_prompt": "Send a Message",
|
||||||
|
"sms_label_phone": "Phone Number",
|
||||||
|
"sms_label_message": "Message",
|
||||||
|
"sms_button_submit": "Send Message"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
src/app.d.ts
vendored
2
src/app.d.ts
vendored
|
|
@ -14,4 +14,4 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,9 @@
|
||||||
label: {
|
label: {
|
||||||
control: 'text',
|
control: 'text',
|
||||||
},
|
},
|
||||||
|
placeholder: {
|
||||||
|
control: 'text',
|
||||||
|
},
|
||||||
size: {
|
size: {
|
||||||
control: 'select',
|
control: 'select',
|
||||||
options: ['xs', 'sm', '-', 'lg'],
|
options: ['xs', 'sm', '-', 'lg'],
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
form?: string;
|
form?: string;
|
||||||
label?: string | Snippet;
|
label?: string | Snippet;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
placeholder?: string;
|
||||||
size?: DaisySize;
|
size?: DaisySize;
|
||||||
};
|
};
|
||||||
let { bordered, color, error, label, size, ...props }: Props = $props();
|
let { bordered, color, error, label, size, ...props }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,4 @@ export const actions = {
|
||||||
success: true,
|
success: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
} satisfies Actions;
|
} satisfies Actions;
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
import { Textarea, TextInput } from '$lib/components/DataInput';
|
import { Textarea, TextInput } from '$lib/components/DataInput';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import type { ActionData } from './$types';
|
import type { ActionData } from './$types';
|
||||||
|
import { messages } from '$lib/i18n';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
form: ActionData;
|
form: ActionData;
|
||||||
|
|
@ -11,12 +12,12 @@
|
||||||
let { form }: Props = $props();
|
let { form }: Props = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#snippet PhoneIcon()}
|
{#snippet PhoneLabel()}
|
||||||
<i class="fi fi-sr-phone-flip"></i>
|
<i class="fi fi-sr-phone-flip"></i> {messages.sms_label_phone()}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
{#snippet MessageLabel()}
|
{#snippet MessageLabel()}
|
||||||
<i class="fi fi-sr-comment-alt"></i> Message
|
<i class="fi fi-sr-comment-alt"></i> {messages.sms_label_message()}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
{#snippet alert(message: string)}
|
{#snippet alert(message: string)}
|
||||||
|
|
@ -27,9 +28,9 @@
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
||||||
<div class="page" transition:fade>
|
<div class="page" transition:fade>
|
||||||
<div class="card bg-base-200 p-4 shadow-xl">
|
<div class="card bg-base-200 px-4 pt-4 shadow-xl">
|
||||||
<div class="card-title justify-center">
|
<div class="card-title justify-center">
|
||||||
<h2 class="text-2xl font-semibold">Send a Message</h2>
|
<h2 class="text-2xl font-semibold">{messages.sms_prompt()}</h2>
|
||||||
{#if form?.error}
|
{#if form?.error}
|
||||||
{@render alert(form.error)}
|
{@render alert(form.error)}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
@ -39,22 +40,22 @@
|
||||||
<TextInput
|
<TextInput
|
||||||
type="tel"
|
type="tel"
|
||||||
name="phone"
|
name="phone"
|
||||||
start={PhoneIcon}
|
label={PhoneLabel}
|
||||||
placeholder="Phone"
|
placeholder="XXX-XXX-XXXX"
|
||||||
bordered
|
bordered
|
||||||
fade
|
fade
|
||||||
/>
|
/>
|
||||||
<Textarea
|
<Textarea
|
||||||
color="primary"
|
|
||||||
label={MessageLabel}
|
label={MessageLabel}
|
||||||
size="lg"
|
size="lg"
|
||||||
error={form?.error}
|
error={form?.error}
|
||||||
name="message"
|
name="message"
|
||||||
|
placeholder="..."
|
||||||
form="sms"
|
form="sms"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions justify-center px-8">
|
<div class="card-actions justify-center px-8 pb-4">
|
||||||
<Button color="primary" type="submit" full>Send Message</Button>
|
<Button outline type="submit" full>{messages.sms_button_submit()}</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -64,4 +65,4 @@
|
||||||
.page {
|
.page {
|
||||||
@apply flex flex-col items-center justify-around gap-24 py-[10%];
|
@apply flex flex-col items-center justify-around gap-24 py-[10%];
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue