feature: localization's first implmentation done. all frontend hardcoded text is now localized.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { Button } from '@/components/ui/shared/Button';
|
||||
import { DialogCloseButton } from '@/components/ui/shared/DialogCloseButton';
|
||||
import { Input } from '@/components/ui/shared/Input';
|
||||
@@ -31,26 +32,29 @@ function CreatePatientFormFields({
|
||||
loading: boolean;
|
||||
showCancel: boolean;
|
||||
}) {
|
||||
const t = useTranslations('patients');
|
||||
const tCommon = useTranslations('common');
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-3">
|
||||
<Input
|
||||
label="First name"
|
||||
label={t('firstName')}
|
||||
value={formData.firstName || ''}
|
||||
onChange={(e) => onChange({ firstName: e.target.value })}
|
||||
/>
|
||||
<Input
|
||||
label="Last name"
|
||||
label={t('lastName')}
|
||||
value={formData.lastName || ''}
|
||||
onChange={(e) => onChange({ lastName: e.target.value })}
|
||||
/>
|
||||
<Input
|
||||
label="Phone"
|
||||
label={t('phone')}
|
||||
value={formData.phone || ''}
|
||||
onChange={(e) => onChange({ phone: e.target.value })}
|
||||
/>
|
||||
<Input
|
||||
label="Email"
|
||||
label={tCommon('email')}
|
||||
type="email"
|
||||
value={formData.email || ''}
|
||||
onChange={(e) => onChange({ email: e.target.value })}
|
||||
@@ -64,11 +68,11 @@ function CreatePatientFormFields({
|
||||
isLoading={loading}
|
||||
disabled={!formData.firstName || !formData.lastName}
|
||||
>
|
||||
Save Patient
|
||||
{t('savePatient')}
|
||||
</Button>
|
||||
{showCancel && (
|
||||
<Button variant="ghost" onClick={onClose}>
|
||||
Cancel
|
||||
{tCommon('cancel')}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
@@ -85,6 +89,8 @@ export function CreatePatientModal({
|
||||
loading = false,
|
||||
variant = 'inline',
|
||||
}: CreatePatientModalProps) {
|
||||
const t = useTranslations('patients');
|
||||
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
@@ -112,7 +118,7 @@ export function CreatePatientModal({
|
||||
id="create-patient-dialog-title"
|
||||
className="text-lg font-semibold text-text-primary pr-2"
|
||||
>
|
||||
New patient
|
||||
{t('dialogTitle')}
|
||||
</h2>
|
||||
<DialogCloseButton onClick={onClose} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user