Spaces:
Sleeping
Sleeping
axeronis commited on
Commit ·
cb33598
1
Parent(s): 487c48b
feat: i18n translations for Register, Settings Brain, Appointments (RU/EN/KY)
Browse files
frontend/app/appointments/page.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import Link from 'next/link'
|
|
| 10 |
import { isSameDay } from 'date-fns'
|
| 11 |
import { useAuth } from '@/contexts/AuthContext'
|
| 12 |
import { motion, AnimatePresence } from 'framer-motion'
|
|
|
|
| 13 |
|
| 14 |
export default function AppointmentsPage() {
|
| 15 |
const { user } = useAuth()
|
|
|
|
| 10 |
import { isSameDay } from 'date-fns'
|
| 11 |
import { useAuth } from '@/contexts/AuthContext'
|
| 12 |
import { motion, AnimatePresence } from 'framer-motion'
|
| 13 |
+
import { useTranslation } from '@/lib/i18n'
|
| 14 |
|
| 15 |
export default function AppointmentsPage() {
|
| 16 |
const { user } = useAuth()
|
frontend/app/register/page.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { useSearchParams } from 'next/navigation'
|
|
| 6 |
import Link from 'next/link'
|
| 7 |
import { Mail, Lock, Building, Loader2, Users, ArrowRight, Eye, EyeOff } from 'lucide-react'
|
| 8 |
import { motion } from 'framer-motion'
|
|
|
|
| 9 |
|
| 10 |
// Компонент для работы с referral code
|
| 11 |
function ReferralCapture({ onReferralCode }: { onReferralCode: (code: string | null) => void }) {
|
|
@@ -32,6 +33,7 @@ export default function RegisterPage() {
|
|
| 32 |
const [isLoading, setIsLoading] = useState(false)
|
| 33 |
const [referralCode, setReferralCode] = useState<string | null>(null)
|
| 34 |
const [showPassword, setShowPassword] = useState(false)
|
|
|
|
| 35 |
|
| 36 |
const handleSubmit = async (e: React.FormEvent) => {
|
| 37 |
console.log('🚀 [RegisterPage] Form submitted!')
|
|
@@ -43,14 +45,14 @@ export default function RegisterPage() {
|
|
| 43 |
// Validate password length
|
| 44 |
if (password.length < 8) {
|
| 45 |
console.log('❌ [RegisterPage] Password too short')
|
| 46 |
-
setError('
|
| 47 |
return
|
| 48 |
}
|
| 49 |
|
| 50 |
// Validate password match
|
| 51 |
if (password !== confirmPassword) {
|
| 52 |
console.log('❌ [RegisterPage] Passwords do not match')
|
| 53 |
-
setError('
|
| 54 |
return
|
| 55 |
}
|
| 56 |
|
|
@@ -106,14 +108,14 @@ export default function RegisterPage() {
|
|
| 106 |
{/* Card */}
|
| 107 |
<div className="glass-card rounded-3xl p-8 md:p-10 border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl shadow-indigo-500/10">
|
| 108 |
<div className="text-center mb-8">
|
| 109 |
-
<h1 className="text-2xl font-bold text-white mb-2">
|
| 110 |
-
<p className="text-slate-400 text-sm">
|
| 111 |
|
| 112 |
{referralCode && (
|
| 113 |
<div className="mt-4 inline-flex items-center gap-2 px-3 py-1.5 bg-indigo-500/10 border border-indigo-500/20 rounded-lg">
|
| 114 |
<Users className="w-3.5 h-3.5 text-indigo-400" />
|
| 115 |
<span className="text-xs text-indigo-300 font-medium">
|
| 116 |
-
|
| 117 |
</span>
|
| 118 |
</div>
|
| 119 |
)}
|
|
@@ -131,7 +133,7 @@ export default function RegisterPage() {
|
|
| 131 |
|
| 132 |
<form onSubmit={handleSubmit} className="space-y-5">
|
| 133 |
<div>
|
| 134 |
-
<label className="block text-xs font-medium text-slate-400 mb-1.5 ml-1">
|
| 135 |
<div className="relative group">
|
| 136 |
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 137 |
<Building className="h-5 w-5 text-slate-500 group-focus-within:text-indigo-400 transition-colors" />
|
|
@@ -167,7 +169,7 @@ export default function RegisterPage() {
|
|
| 167 |
</div>
|
| 168 |
|
| 169 |
<div>
|
| 170 |
-
<label className="block text-xs font-medium text-slate-400 mb-1.5 ml-1">
|
| 171 |
<div className="relative group">
|
| 172 |
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 173 |
<Lock className="h-5 w-5 text-slate-500 group-focus-within:text-indigo-400 transition-colors" />
|
|
@@ -191,12 +193,12 @@ export default function RegisterPage() {
|
|
| 191 |
</div>
|
| 192 |
<p className="mt-2 text-xs text-slate-500 flex items-center gap-1 ml-1">
|
| 193 |
<span className="w-1 h-1 rounded-full bg-slate-500" />
|
| 194 |
-
|
| 195 |
</p>
|
| 196 |
</div>
|
| 197 |
|
| 198 |
<div>
|
| 199 |
-
<label className="block text-xs font-medium text-slate-400 mb-1.5 ml-1">
|
| 200 |
<div className="relative group">
|
| 201 |
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 202 |
<Lock className="h-5 w-5 text-slate-500 group-focus-within:text-indigo-400 transition-colors" />
|
|
@@ -222,7 +224,7 @@ export default function RegisterPage() {
|
|
| 222 |
<Loader2 className="w-5 h-5 animate-spin" />
|
| 223 |
) : (
|
| 224 |
<span className="flex items-center gap-2">
|
| 225 |
-
|
| 226 |
</span>
|
| 227 |
)}
|
| 228 |
</button>
|
|
@@ -231,9 +233,9 @@ export default function RegisterPage() {
|
|
| 231 |
|
| 232 |
<div className="text-center mt-6">
|
| 233 |
<p className="text-sm text-slate-500">
|
| 234 |
-
|
| 235 |
<Link href="/login" className="font-medium text-indigo-400 hover:text-indigo-300 transition-colors">
|
| 236 |
-
|
| 237 |
</Link>
|
| 238 |
</p>
|
| 239 |
</div>
|
|
|
|
| 6 |
import Link from 'next/link'
|
| 7 |
import { Mail, Lock, Building, Loader2, Users, ArrowRight, Eye, EyeOff } from 'lucide-react'
|
| 8 |
import { motion } from 'framer-motion'
|
| 9 |
+
import { useTranslation } from '@/lib/i18n'
|
| 10 |
|
| 11 |
// Компонент для работы с referral code
|
| 12 |
function ReferralCapture({ onReferralCode }: { onReferralCode: (code: string | null) => void }) {
|
|
|
|
| 33 |
const [isLoading, setIsLoading] = useState(false)
|
| 34 |
const [referralCode, setReferralCode] = useState<string | null>(null)
|
| 35 |
const [showPassword, setShowPassword] = useState(false)
|
| 36 |
+
const { t } = useTranslation()
|
| 37 |
|
| 38 |
const handleSubmit = async (e: React.FormEvent) => {
|
| 39 |
console.log('🚀 [RegisterPage] Form submitted!')
|
|
|
|
| 45 |
// Validate password length
|
| 46 |
if (password.length < 8) {
|
| 47 |
console.log('❌ [RegisterPage] Password too short')
|
| 48 |
+
setError(t('auth.passwordTooShort'))
|
| 49 |
return
|
| 50 |
}
|
| 51 |
|
| 52 |
// Validate password match
|
| 53 |
if (password !== confirmPassword) {
|
| 54 |
console.log('❌ [RegisterPage] Passwords do not match')
|
| 55 |
+
setError(t('errors.passwordMismatch'))
|
| 56 |
return
|
| 57 |
}
|
| 58 |
|
|
|
|
| 108 |
{/* Card */}
|
| 109 |
<div className="glass-card rounded-3xl p-8 md:p-10 border border-white/10 bg-white/5 backdrop-blur-xl shadow-2xl shadow-indigo-500/10">
|
| 110 |
<div className="text-center mb-8">
|
| 111 |
+
<h1 className="text-2xl font-bold text-white mb-2">{t('auth.createAccount')}</h1>
|
| 112 |
+
<p className="text-slate-400 text-sm">{t('auth.joinCompanies')}</p>
|
| 113 |
|
| 114 |
{referralCode && (
|
| 115 |
<div className="mt-4 inline-flex items-center gap-2 px-3 py-1.5 bg-indigo-500/10 border border-indigo-500/20 rounded-lg">
|
| 116 |
<Users className="w-3.5 h-3.5 text-indigo-400" />
|
| 117 |
<span className="text-xs text-indigo-300 font-medium">
|
| 118 |
+
{t('auth.partnerInvite')}
|
| 119 |
</span>
|
| 120 |
</div>
|
| 121 |
)}
|
|
|
|
| 133 |
|
| 134 |
<form onSubmit={handleSubmit} className="space-y-5">
|
| 135 |
<div>
|
| 136 |
+
<label className="block text-xs font-medium text-slate-400 mb-1.5 ml-1">{t('auth.companyName')}</label>
|
| 137 |
<div className="relative group">
|
| 138 |
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 139 |
<Building className="h-5 w-5 text-slate-500 group-focus-within:text-indigo-400 transition-colors" />
|
|
|
|
| 169 |
</div>
|
| 170 |
|
| 171 |
<div>
|
| 172 |
+
<label className="block text-xs font-medium text-slate-400 mb-1.5 ml-1">{t('auth.password')}</label>
|
| 173 |
<div className="relative group">
|
| 174 |
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 175 |
<Lock className="h-5 w-5 text-slate-500 group-focus-within:text-indigo-400 transition-colors" />
|
|
|
|
| 193 |
</div>
|
| 194 |
<p className="mt-2 text-xs text-slate-500 flex items-center gap-1 ml-1">
|
| 195 |
<span className="w-1 h-1 rounded-full bg-slate-500" />
|
| 196 |
+
{t('auth.minChars')}
|
| 197 |
</p>
|
| 198 |
</div>
|
| 199 |
|
| 200 |
<div>
|
| 201 |
+
<label className="block text-xs font-medium text-slate-400 mb-1.5 ml-1">{t('auth.confirmPassword')}</label>
|
| 202 |
<div className="relative group">
|
| 203 |
<div className="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
|
| 204 |
<Lock className="h-5 w-5 text-slate-500 group-focus-within:text-indigo-400 transition-colors" />
|
|
|
|
| 224 |
<Loader2 className="w-5 h-5 animate-spin" />
|
| 225 |
) : (
|
| 226 |
<span className="flex items-center gap-2">
|
| 227 |
+
{t('auth.createAccount')} <ArrowRight className="w-4 h-4" />
|
| 228 |
</span>
|
| 229 |
)}
|
| 230 |
</button>
|
|
|
|
| 233 |
|
| 234 |
<div className="text-center mt-6">
|
| 235 |
<p className="text-sm text-slate-500">
|
| 236 |
+
{t('auth.alreadyHaveAccount')}{' '}
|
| 237 |
<Link href="/login" className="font-medium text-indigo-400 hover:text-indigo-300 transition-colors">
|
| 238 |
+
{t('auth.login')}
|
| 239 |
</Link>
|
| 240 |
</p>
|
| 241 |
</div>
|
frontend/app/settings/brain/page.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import ProductSettings from '@/components/settings/ProductSettings'
|
|
| 15 |
import { useDropzone } from 'react-dropzone'
|
| 16 |
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
| 17 |
import { useToast } from '@/contexts/ToastContext'
|
|
|
|
| 18 |
|
| 19 |
interface AISettings {
|
| 20 |
business_description: string
|
|
|
|
| 15 |
import { useDropzone } from 'react-dropzone'
|
| 16 |
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
| 17 |
import { useToast } from '@/contexts/ToastContext'
|
| 18 |
+
import { useTranslation } from '@/lib/i18n'
|
| 19 |
|
| 20 |
interface AISettings {
|
| 21 |
business_description: string
|
frontend/lib/i18n/translations/en.ts
CHANGED
|
@@ -104,6 +104,10 @@ export const en = {
|
|
| 104 |
loginSubtitle: 'Sign in to your MicroFunnel account',
|
| 105 |
createFree: 'Create for free',
|
| 106 |
registerSubtitle: 'Start using AI for sales',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
},
|
| 108 |
|
| 109 |
// Dashboard
|
|
|
|
| 104 |
loginSubtitle: 'Sign in to your MicroFunnel account',
|
| 105 |
createFree: 'Create for free',
|
| 106 |
registerSubtitle: 'Start using AI for sales',
|
| 107 |
+
joinCompanies: 'Join 500+ companies',
|
| 108 |
+
partnerInvite: 'Partner invitation',
|
| 109 |
+
passwordTooShort: 'Password must be at least 8 characters',
|
| 110 |
+
minChars: 'Minimum 8 characters',
|
| 111 |
},
|
| 112 |
|
| 113 |
// Dashboard
|
frontend/lib/i18n/translations/ky.ts
CHANGED
|
@@ -104,6 +104,10 @@ export const ky = {
|
|
| 104 |
loginSubtitle: 'MicroFunnel аккаунтуңузга кириңиз',
|
| 105 |
createFree: 'Акысыз түзүү',
|
| 106 |
registerSubtitle: 'Сатуу үчүн AI колдонууну баштаңыз',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
},
|
| 108 |
|
| 109 |
// Dashboard
|
|
|
|
| 104 |
loginSubtitle: 'MicroFunnel аккаунтуңузга кириңиз',
|
| 105 |
createFree: 'Акысыз түзүү',
|
| 106 |
registerSubtitle: 'Сатуу үчүн AI колдонууну баштаңыз',
|
| 107 |
+
joinCompanies: '500+ компанияларга кошулуңуз',
|
| 108 |
+
partnerInvite: 'Өнөктөштөн чакыруу',
|
| 109 |
+
passwordTooShort: 'Сыр сөз кеминде 8 символдон турушу керек',
|
| 110 |
+
minChars: 'Минимум 8 символ',
|
| 111 |
},
|
| 112 |
|
| 113 |
// Dashboard
|
frontend/lib/i18n/translations/ru.ts
CHANGED
|
@@ -104,6 +104,10 @@ export const ru = {
|
|
| 104 |
loginSubtitle: 'Войдите в свой аккаунт MicroFunnel',
|
| 105 |
createFree: 'Создать бесплатно',
|
| 106 |
registerSubtitle: 'Начните использовать AI для продаж',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
},
|
| 108 |
|
| 109 |
// Dashboard
|
|
|
|
| 104 |
loginSubtitle: 'Войдите в свой аккаунт MicroFunnel',
|
| 105 |
createFree: 'Создать бесплатно',
|
| 106 |
registerSubtitle: 'Начните использовать AI для продаж',
|
| 107 |
+
joinCompanies: 'Присоединяйтесь к 500+ компаниям',
|
| 108 |
+
partnerInvite: 'Приглашение от партнера',
|
| 109 |
+
passwordTooShort: 'Пароль должен содержать минимум 8 символов',
|
| 110 |
+
minChars: 'Минимум 8 символов',
|
| 111 |
},
|
| 112 |
|
| 113 |
// Dashboard
|