Spaces:
Running

axeronis commited on
Commit
487c48b
·
1 Parent(s): a10d642

feat: i18n translations for Channels, Chats, Billing, Login (RU/EN/KY)

Browse files
frontend/app/channels/page.tsx CHANGED
@@ -8,6 +8,7 @@ import { channelsApi } from '@/lib/api'
8
  import { Loader2, CheckCircle2, AlertCircle, X, ExternalLink, Settings2, Key, Smartphone, Building2 } from 'lucide-react'
9
  import { motion, AnimatePresence } from 'framer-motion'
10
  import { cn } from '@/lib/utils'
 
11
 
12
  // Types
13
  type ChannelType = 'whatsapp' | 'instagram' | 'telegram'
@@ -33,6 +34,7 @@ export default function ChannelsPage() {
33
 
34
  // Modals state
35
  const [connectType, setConnectType] = useState<ChannelType | null>(null)
 
36
 
37
  // Data Queries
38
  const { data: telegramStatus } = useQuery({
@@ -87,9 +89,9 @@ export default function ChannelsPage() {
87
  {/* Header */}
88
  <div className="mb-10">
89
  <h1 className="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-white to-slate-400 mb-2">
90
- Подключения
91
  </h1>
92
- <p className="text-slate-400">Управляйте интеграциями с мессенджерами</p>
93
  </div>
94
 
95
  {/* Grid with Stats Panel */}
@@ -104,7 +106,7 @@ export default function ChannelsPage() {
104
  icon={<WhatsAppIcon className="w-24 h-24 text-white" />}
105
  gradient="from-emerald-500 to-[#0A3D25]"
106
  isConnected={false}
107
- statusText="Скоро"
108
  isComingSoon
109
  stats={{ users: 0, messages: 0, clicks: 0 }}
110
  onConfigure={() => { }} // Disabled for now
@@ -117,7 +119,7 @@ export default function ChannelsPage() {
117
  icon={<InstagramIcon className="w-24 h-24 text-white" />}
118
  gradient="from-[#E1306C] to-[#581C87]"
119
  isConnected={false}
120
- statusText="Скоро"
121
  isComingSoon
122
  stats={{ users: 0, messages: 0, clicks: 0 }}
123
  onConfigure={() => { }} // Placeholder
 
8
  import { Loader2, CheckCircle2, AlertCircle, X, ExternalLink, Settings2, Key, Smartphone, Building2 } from 'lucide-react'
9
  import { motion, AnimatePresence } from 'framer-motion'
10
  import { cn } from '@/lib/utils'
11
+ import { useTranslation } from '@/lib/i18n'
12
 
13
  // Types
14
  type ChannelType = 'whatsapp' | 'instagram' | 'telegram'
 
34
 
35
  // Modals state
36
  const [connectType, setConnectType] = useState<ChannelType | null>(null)
37
+ const { t } = useTranslation()
38
 
39
  // Data Queries
40
  const { data: telegramStatus } = useQuery({
 
89
  {/* Header */}
90
  <div className="mb-10">
91
  <h1 className="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-white to-slate-400 mb-2">
92
+ {t('channels.title')}
93
  </h1>
94
+ <p className="text-slate-400">{t('channels.subtitle')}</p>
95
  </div>
96
 
97
  {/* Grid with Stats Panel */}
 
106
  icon={<WhatsAppIcon className="w-24 h-24 text-white" />}
107
  gradient="from-emerald-500 to-[#0A3D25]"
108
  isConnected={false}
109
+ statusText={t('channels.comingSoon')}
110
  isComingSoon
111
  stats={{ users: 0, messages: 0, clicks: 0 }}
112
  onConfigure={() => { }} // Disabled for now
 
119
  icon={<InstagramIcon className="w-24 h-24 text-white" />}
120
  gradient="from-[#E1306C] to-[#581C87]"
121
  isConnected={false}
122
+ statusText={t('channels.comingSoon')}
123
  isComingSoon
124
  stats={{ users: 0, messages: 0, clicks: 0 }}
125
  onConfigure={() => { }} // Placeholder
frontend/app/chats/page.tsx CHANGED
@@ -12,6 +12,7 @@ import { ClientCard } from '@/components/ClientCard'
12
  import { Loader2, MessageCircle } from 'lucide-react'
13
  import { cn } from '@/lib/utils'
14
  import { AnimatePresence, motion } from 'framer-motion'
 
15
 
16
  // Main Content Component
17
  function ChatsContent() {
@@ -27,6 +28,7 @@ function ChatsContent() {
27
  const [conversation, setConversation] = useState<any>(null)
28
  const [isLeadsListOpen, setIsLeadsListOpen] = useState(true)
29
  const [isMobileSummaryOpen, setIsMobileSummaryOpen] = useState(false)
 
30
 
31
  // Fetch Leads
32
  const { data: leads, isLoading: leadsLoading, refetch: refetchLeads } = useQuery({
 
12
  import { Loader2, MessageCircle } from 'lucide-react'
13
  import { cn } from '@/lib/utils'
14
  import { AnimatePresence, motion } from 'framer-motion'
15
+ import { useTranslation } from '@/lib/i18n'
16
 
17
  // Main Content Component
18
  function ChatsContent() {
 
28
  const [conversation, setConversation] = useState<any>(null)
29
  const [isLeadsListOpen, setIsLeadsListOpen] = useState(true)
30
  const [isMobileSummaryOpen, setIsMobileSummaryOpen] = useState(false)
31
+ const { t } = useTranslation()
32
 
33
  // Fetch Leads
34
  const { data: leads, isLoading: leadsLoading, refetch: refetchLeads } = useQuery({
frontend/app/login/page.tsx CHANGED
@@ -5,6 +5,7 @@ import { useAuth } from '@/contexts/AuthContext'
5
  import Link from 'next/link'
6
  import { Mail, Lock, Loader2, ArrowRight } from 'lucide-react'
7
  import { motion } from 'framer-motion'
 
8
 
9
  export default function LoginPage() {
10
  const { login, isLoading: authLoading } = useAuth()
@@ -12,6 +13,7 @@ export default function LoginPage() {
12
  const [password, setPassword] = useState('')
13
  const [error, setError] = useState('')
14
  const [isLoading, setIsLoading] = useState(false)
 
15
 
16
  const handleSubmit = async (e: React.FormEvent) => {
17
  e.preventDefault()
@@ -60,8 +62,8 @@ export default function LoginPage() {
60
  {/* Card */}
61
  <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">
62
  <div className="text-center mb-8">
63
- <h1 className="text-2xl font-bold text-white mb-2">С возвращением</h1>
64
- <p className="text-slate-400 text-sm">Войдите в свой аккаунт MicroFunnel</p>
65
  </div>
66
 
67
  {error && (
@@ -95,9 +97,9 @@ export default function LoginPage() {
95
 
96
  <div>
97
  <div className="flex items-center justify-between mb-1.5 ml-1">
98
- <label className="block text-xs font-medium text-slate-400">Пароль</label>
99
  <Link href="#" className="text-xs text-indigo-400 hover:text-indigo-300 transition-colors">
100
- Забыли пароль?
101
  </Link>
102
  </div>
103
  <div className="relative group">
@@ -125,7 +127,7 @@ export default function LoginPage() {
125
  <Loader2 className="w-5 h-5 animate-spin" />
126
  ) : (
127
  <span className="flex items-center gap-2">
128
- Войти <ArrowRight className="w-4 h-4" />
129
  </span>
130
  )}
131
  </button>
@@ -134,9 +136,9 @@ export default function LoginPage() {
134
 
135
  <div className="text-center mt-6">
136
  <p className="text-sm text-slate-500">
137
- Нет аккаунта?{' '}
138
  <Link href="/register" className="font-medium text-indigo-400 hover:text-indigo-300 transition-colors">
139
- Создать бесплатно
140
  </Link>
141
  </p>
142
  </div>
 
5
  import Link from 'next/link'
6
  import { Mail, Lock, Loader2, ArrowRight } from 'lucide-react'
7
  import { motion } from 'framer-motion'
8
+ import { useTranslation } from '@/lib/i18n'
9
 
10
  export default function LoginPage() {
11
  const { login, isLoading: authLoading } = useAuth()
 
13
  const [password, setPassword] = useState('')
14
  const [error, setError] = useState('')
15
  const [isLoading, setIsLoading] = useState(false)
16
+ const { t } = useTranslation()
17
 
18
  const handleSubmit = async (e: React.FormEvent) => {
19
  e.preventDefault()
 
62
  {/* Card */}
63
  <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">
64
  <div className="text-center mb-8">
65
+ <h1 className="text-2xl font-bold text-white mb-2">{t('auth.welcomeBack')}</h1>
66
+ <p className="text-slate-400 text-sm">{t('auth.loginSubtitle')}</p>
67
  </div>
68
 
69
  {error && (
 
97
 
98
  <div>
99
  <div className="flex items-center justify-between mb-1.5 ml-1">
100
+ <label className="block text-xs font-medium text-slate-400">{t('auth.password')}</label>
101
  <Link href="#" className="text-xs text-indigo-400 hover:text-indigo-300 transition-colors">
102
+ {t('auth.forgotPassword')}
103
  </Link>
104
  </div>
105
  <div className="relative group">
 
127
  <Loader2 className="w-5 h-5 animate-spin" />
128
  ) : (
129
  <span className="flex items-center gap-2">
130
+ {t('auth.login')} <ArrowRight className="w-4 h-4" />
131
  </span>
132
  )}
133
  </button>
 
136
 
137
  <div className="text-center mt-6">
138
  <p className="text-sm text-slate-500">
139
+ {t('auth.dontHaveAccount')}{' '}
140
  <Link href="/register" className="font-medium text-indigo-400 hover:text-indigo-300 transition-colors">
141
+ {t('auth.createFree')}
142
  </Link>
143
  </p>
144
  </div>
frontend/app/settings/billing/page.tsx CHANGED
@@ -11,6 +11,7 @@ import { cn } from '@/lib/utils'
11
  import { api } from '@/lib/api'
12
  import { useSearchParams } from 'next/navigation'
13
  import { useAuth } from '@/contexts/AuthContext'
 
14
 
15
  // Interfaces
16
  interface BillingResponse {
@@ -69,6 +70,7 @@ export default function BillingPage() {
69
  const canceled = searchParams.get('canceled')
70
  const mockPlan = searchParams.get('mock_plan')
71
  const [showToast, setShowToast] = useState<{ type: 'success' | 'error', message: string } | null>(null)
 
72
 
73
  // React Query for billing data - cached!
74
  const { data, isLoading: loading, refetch } = useQuery<BillingResponse>({
 
11
  import { api } from '@/lib/api'
12
  import { useSearchParams } from 'next/navigation'
13
  import { useAuth } from '@/contexts/AuthContext'
14
+ import { useTranslation } from '@/lib/i18n'
15
 
16
  // Interfaces
17
  interface BillingResponse {
 
70
  const canceled = searchParams.get('canceled')
71
  const mockPlan = searchParams.get('mock_plan')
72
  const [showToast, setShowToast] = useState<{ type: 'success' | 'error', message: string } | null>(null)
73
+ const { t } = useTranslation()
74
 
75
  // React Query for billing data - cached!
76
  const { data, isLoading: loading, refetch } = useQuery<BillingResponse>({
frontend/lib/i18n/translations/en.ts CHANGED
@@ -100,6 +100,10 @@ export const en = {
100
  invalidCredentials: 'Invalid email or password',
101
  accountCreated: 'Account created! Check your email.',
102
  passwordResetSent: 'Reset instructions sent to email',
 
 
 
 
103
  },
104
 
105
  // Dashboard
 
100
  invalidCredentials: 'Invalid email or password',
101
  accountCreated: 'Account created! Check your email.',
102
  passwordResetSent: 'Reset instructions sent to email',
103
+ welcomeBack: 'Welcome back',
104
+ loginSubtitle: 'Sign in to your MicroFunnel account',
105
+ createFree: 'Create for free',
106
+ registerSubtitle: 'Start using AI for sales',
107
  },
108
 
109
  // Dashboard
frontend/lib/i18n/translations/ky.ts CHANGED
@@ -100,6 +100,10 @@ export const ky = {
100
  invalidCredentials: 'Туура эмес email же сыр сөз',
101
  accountCreated: 'Аккаунт түзүлдү! Emailиңизди текшериңиз.',
102
  passwordResetSent: 'Нускамалар emailге жөнөтүлдү',
 
 
 
 
103
  },
104
 
105
  // Dashboard
 
100
  invalidCredentials: 'Туура эмес email же сыр сөз',
101
  accountCreated: 'Аккаунт түзүлдү! Emailиңизди текшериңиз.',
102
  passwordResetSent: 'Нускамалар emailге жөнөтүлдү',
103
+ welcomeBack: 'Кайра кош келиңиз',
104
+ loginSubtitle: 'MicroFunnel аккаунтуңузга кириңиз',
105
+ createFree: 'Акысыз түзүү',
106
+ registerSubtitle: 'Сатуу үчүн AI колдонууну баштаңыз',
107
  },
108
 
109
  // Dashboard
frontend/lib/i18n/translations/ru.ts CHANGED
@@ -100,6 +100,10 @@ export const ru = {
100
  invalidCredentials: 'Неверный email или пароль',
101
  accountCreated: 'Аккаунт создан! Проверьте почту.',
102
  passwordResetSent: 'Инструкции отправлены на email',
 
 
 
 
103
  },
104
 
105
  // Dashboard
 
100
  invalidCredentials: 'Неверный email или пароль',
101
  accountCreated: 'Аккаунт создан! Проверьте почту.',
102
  passwordResetSent: 'Инструкции отправлены на email',
103
+ welcomeBack: 'С возвращением',
104
+ loginSubtitle: 'Войдите в свой аккаунт MicroFunnel',
105
+ createFree: 'Создать бесплатно',
106
+ registerSubtitle: 'Начните использовать AI для продаж',
107
  },
108
 
109
  // Dashboard