@innvisor/conny-ai 9.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +68 -0
- package/CHANGELOG.md +54 -0
- package/LICENSE +21 -0
- package/README.md +369 -0
- package/brand-assets/A_dark_luxury_web_background_202605210700.jpeg +0 -0
- package/brand-assets/Conny.web.logo.png +0 -0
- package/brand-assets/Logo_Conny_Petalo_Claro.png +0 -0
- package/brand-assets/cl-nica-de-las-am-ricas/manifest.json +22 -0
- package/brand-assets/cl-nica-de-las-am-ricas/processed/business-identity.txt +11 -0
- package/brand-assets/cl-nica-de-las-am-ricas/raw/business-identity.txt +11 -0
- package/brand-assets/cl-nica-las-am-ricas/manifest.json +22 -0
- package/brand-assets/cl-nica-las-am-ricas/processed/business-identity.txt +11 -0
- package/brand-assets/cl-nica-las-am-ricas/raw/business-identity.txt +11 -0
- package/brand-assets/conny-demo/manifest.json +22 -0
- package/brand-assets/conny-demo/processed/business-identity.txt +7 -0
- package/brand-assets/conny-demo/raw/business-identity.txt +7 -0
- package/brand-assets/conny-logo.png +0 -0
- package/brand-assets/web.background.png +0 -0
- package/brand_assets.py +323 -0
- package/conny +28 -0
- package/conny-chat.py +579 -0
- package/conny-omni.py +3843 -0
- package/conny.py +113 -0
- package/conny_agents/__init__.py +1 -0
- package/conny_agents/agenda.py +1 -0
- package/conny_agents/captacion.py +1 -0
- package/conny_agents/conocimiento.py +1 -0
- package/conny_agents/escalacion.py +1 -0
- package/conny_agents/objeciones.py +1 -0
- package/conny_agents/seguimiento.py +1 -0
- package/conny_app.py +287 -0
- package/conny_audio.py +350 -0
- package/conny_audio_learn.py +84 -0
- package/conny_brain_v10.py +804 -0
- package/conny_bridge.py +656 -0
- package/conny_calendar.py +169 -0
- package/conny_cli.py +11784 -0
- package/conny_cli_bb.py +437 -0
- package/conny_commands.py +243 -0
- package/conny_config.py +215 -0
- package/conny_core/__init__.py +3 -0
- package/conny_core/conversation_engine.py +446 -0
- package/conny_core/first_turn_ops.py +287 -0
- package/conny_core/persona_registry.py +157 -0
- package/conny_core/prompt_ops.py +561 -0
- package/conny_cron.py +72 -0
- package/conny_demo_v2.py +209 -0
- package/conny_demo_voice.py +134 -0
- package/conny_design.py +43 -0
- package/conny_doctor.py +319 -0
- package/conny_domino.py +696 -0
- package/conny_generator.py +447 -0
- package/conny_google_auth.py +159 -0
- package/conny_i18n.py +619 -0
- package/conny_init.py +509 -0
- package/conny_integrations/__init__.py +4 -0
- package/conny_integrations/llm.py +1 -0
- package/conny_integrations/vault.py +77 -0
- package/conny_integrations/whatsapp.py +1 -0
- package/conny_intelligence.py +65 -0
- package/conny_learning.py +154 -0
- package/conny_memory.py +243 -0
- package/conny_memory_engine.py +292 -0
- package/conny_nova_proxy.py +170 -0
- package/conny_nuke_robot_phrases.py +493 -0
- package/conny_pairing.py +253 -0
- package/conny_patch.py +291 -0
- package/conny_persona_cli.py +150 -0
- package/conny_router.py +308 -0
- package/conny_runtime_ops.py +271 -0
- package/conny_session.py +516 -0
- package/conny_skills/__init__.py +1 -0
- package/conny_skills/demo_mode.py +35 -0
- package/conny_skills/text_processing.py +1 -0
- package/conny_skills/tone_detection.py +1 -0
- package/conny_smart_features.py +333 -0
- package/conny_studio.py +161 -0
- package/conny_sync_fix.py +306 -0
- package/conny_tui.py +512 -0
- package/conny_tui_select.py +202 -0
- package/conny_ultra_config.py +411 -0
- package/conny_uncertainty.py +174 -0
- package/conny_utils.py +87 -0
- package/conny_voice.py +156 -0
- package/conny_voice_engine.py +124 -0
- package/conny_web_search.py +66 -0
- package/conny_weekly_report.py +85 -0
- package/conny_worm.py +88 -0
- package/core/__init__.py +25 -0
- package/ecosystem.config.js +24 -0
- package/fix_init.py +27 -0
- package/install.sh +78 -0
- package/knowledge_base.py +330 -0
- package/nova/rules/default.yaml +37 -0
- package/nova_bridge.py +509 -0
- package/npm/conny.js +471 -0
- package/package.json +102 -0
- package/personas/conny/base/default.yaml +35 -0
- package/personas/conny/base/estetica_whatsapp.yaml +36 -0
- package/requirements.txt +14 -0
- package/run.sh +47 -0
- package/search.py +465 -0
- package/smart_handoff.py +1150 -0
- package/src/__init__.py +0 -0
- package/src/conny/__init__.py +0 -0
- package/src/conny/admin/__init__.py +0 -0
- package/src/conny/admin/api.py +234 -0
- package/src/conny/admin/dashboard.py +772 -0
- package/src/conny/api/__init__.py +0 -0
- package/src/conny/api/routes.py +8851 -0
- package/src/conny/brain/__init__.py +15 -0
- package/src/conny/brain/engine.py +804 -0
- package/src/conny/brain/learning.py +154 -0
- package/src/conny/brain/memory.py +324 -0
- package/src/conny/brain/smart_features.py +333 -0
- package/src/conny/brain/uncertainty.py +167 -0
- package/src/conny/channels/__init__.py +0 -0
- package/src/conny/channels/audio.py +316 -0
- package/src/conny/channels/cli.py +11795 -0
- package/src/conny/channels/logo_art.py +11 -0
- package/src/conny/channels/voice.py +156 -0
- package/src/conny/core/__init__.py +0 -0
- package/src/conny/core/config.py +215 -0
- package/src/conny/core/cron.py +72 -0
- package/src/conny/core/messenger.py +563 -0
- package/src/conny/core/router.py +297 -0
- package/src/conny/core/session.py +312 -0
- package/src/conny/demo/__init__.py +0 -0
- package/src/conny/demo/handler.py +3110 -0
- package/src/conny/integrations/__init__.py +19 -0
- package/src/conny/integrations/calendar.py +169 -0
- package/src/conny/integrations/knowledge.py +312 -0
- package/src/conny/integrations/search.py +66 -0
- package/src/conny/personas/__init__.py +0 -0
- package/src/conny/personas/generator.py +447 -0
- package/src/conny/production/__init__.py +0 -0
- package/src/conny/production/domino.py +696 -0
- package/src/conny/production/guard.py +550 -0
- package/src/conny/production/handoff.py +1150 -0
- package/src/conny/production/monitor.py +353 -0
- package/src/conny/utils/__init__.py +2 -0
- package/src/conny/utils/helpers.py +75 -0
- package/src/conny/utils/i18n.py +619 -0
- package/src/core/admin_engines.py +772 -0
- package/src/core/globals.py +11845 -0
- package/src/core/orchestrator.py +273 -0
- package/src/core/production_monitor.py +353 -0
- package/src/core/runtime.py +5487 -0
- package/src/domain/onboarding_flow.py +230 -0
- package/src/domain/prompts/__init__.py +1 -0
- package/src/domain/prompts/prospect_pitch.py +282 -0
- package/src/domain/send_guard.py +636 -0
- package/src/domain/swarm/queen.py +96 -0
- package/src/infrastructure/llm_providers/engine.py +487 -0
- package/src/interfaces/mcp_server.py +73 -0
- package/src/interfaces/nova_bridge.py +58 -0
- package/src/interfaces/web/admin_api.py +1379 -0
- package/src/interfaces/web/app.py +9408 -0
- package/src/interfaces/web/demo_handler.py +3450 -0
- package/src/interfaces/web/static/generate_avatars.py +46 -0
- package/v7/__init__.py +46 -0
- package/v7/agents/__init__.py +46 -0
- package/v7/agents/agenda.py +77 -0
- package/v7/agents/base.py +216 -0
- package/v7/agents/captacion.py +60 -0
- package/v7/agents/conocimiento.py +69 -0
- package/v7/agents/escalacion.py +83 -0
- package/v7/agents/objeciones.py +109 -0
- package/v7/agents/seguimiento.py +71 -0
- package/v7/memory/__init__.py +46 -0
- package/v7/memory/patient_profile.py +200 -0
- package/v7/orchestrator.py +275 -0
- package/v7/postprocess.py +127 -0
- package/v7/router.py +239 -0
- package/verify_conversation_impl.py +48 -0
package/conny_i18n.py
ADDED
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
conny_i18n.py — Multilingual support for Conny
|
|
4
|
+
Supported languages: es, en, pt, fr, de
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
from typing import Dict, Optional
|
|
9
|
+
from dataclasses import dataclass
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
SUPPORTED_LANGUAGES = {
|
|
13
|
+
"es": "Español",
|
|
14
|
+
"en": "English",
|
|
15
|
+
"pt": "Português",
|
|
16
|
+
"fr": "Français",
|
|
17
|
+
"de": "Deutsch",
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
DEFAULT_LANGUAGE = "es"
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass
|
|
24
|
+
class TranslationSet:
|
|
25
|
+
ui: Dict[str, str]
|
|
26
|
+
bot: Dict[str, str]
|
|
27
|
+
demo: Dict[str, str]
|
|
28
|
+
admin: Dict[str, str]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _es() -> TranslationSet:
|
|
32
|
+
return TranslationSet(
|
|
33
|
+
ui={
|
|
34
|
+
"dashboard": "Dashboard",
|
|
35
|
+
"instances": "Instancias",
|
|
36
|
+
"status": "Estado",
|
|
37
|
+
"running": "Ejecutando",
|
|
38
|
+
"stopped": "Detenida",
|
|
39
|
+
"error": "Error",
|
|
40
|
+
"start": "Iniciar",
|
|
41
|
+
"stop": "Detener",
|
|
42
|
+
"restart": "Reiniciar",
|
|
43
|
+
"delete": "Eliminar",
|
|
44
|
+
"create": "Crear",
|
|
45
|
+
"cancel": "Cancelar",
|
|
46
|
+
"confirm": "Confirmar",
|
|
47
|
+
"back": "Volver",
|
|
48
|
+
"next": "Siguiente",
|
|
49
|
+
"help": "Ayuda",
|
|
50
|
+
"loading": "Cargando...",
|
|
51
|
+
"success": "Éxito",
|
|
52
|
+
"warning": "Advertencia",
|
|
53
|
+
"language": "Idioma",
|
|
54
|
+
"select_language": "Seleccionar idioma",
|
|
55
|
+
"enter_number": "Ingresa un número",
|
|
56
|
+
"press_enter": "Presiona Enter",
|
|
57
|
+
"no_instances": "No hay instancias",
|
|
58
|
+
"create_first": "Crea tu primera instancia",
|
|
59
|
+
"exit": "Salir",
|
|
60
|
+
"menu": "Menú",
|
|
61
|
+
"options": "Opciones",
|
|
62
|
+
"install": "Instalar",
|
|
63
|
+
"init": "Iniciar",
|
|
64
|
+
"new": "Nueva",
|
|
65
|
+
"list": "Listar",
|
|
66
|
+
"chat": "Chat",
|
|
67
|
+
"sync": "Sincronizar",
|
|
68
|
+
"fix": "Reparar",
|
|
69
|
+
"health": "Salud",
|
|
70
|
+
"logs": "Logs",
|
|
71
|
+
"config": "Configurar",
|
|
72
|
+
"guide": "Guía",
|
|
73
|
+
"doctor": "Doctor",
|
|
74
|
+
"upgrade": "Actualizar",
|
|
75
|
+
"metrics": "Métricas",
|
|
76
|
+
"stats": "Estadísticas",
|
|
77
|
+
"backup": "Backup",
|
|
78
|
+
"test": "Probar",
|
|
79
|
+
"secure": "Seguridad",
|
|
80
|
+
"welcome": "Bienvenido a Conny",
|
|
81
|
+
"enter_choice": "Ingresa tu opción",
|
|
82
|
+
},
|
|
83
|
+
bot={
|
|
84
|
+
"welcome": "¡Hola! 👋 Soy Conny, tu asistente virtual. ¿En qué puedo ayudarte hoy?",
|
|
85
|
+
"greeting": "¡Hola! ¿Cómo estás?",
|
|
86
|
+
"thanks": "¡Gracias por tu confianza!",
|
|
87
|
+
"goodbye": "Fue un placer ayudarte. ¡Hasta pronto! 👋",
|
|
88
|
+
"processing": "Déjame un momento...",
|
|
89
|
+
"typing": "Escribiendo...",
|
|
90
|
+
"error_occurred": "Ups, algo salió mal. Intenta de nuevo.",
|
|
91
|
+
"not_understood": "No entendí tu mensaje. ¿Podrías reformularlo?",
|
|
92
|
+
"menu": "Te muestro las opciones:",
|
|
93
|
+
"hours": "Horario de atención",
|
|
94
|
+
"location": "Ubicación",
|
|
95
|
+
"contact": "Contacto",
|
|
96
|
+
"appointment": "Reservar cita",
|
|
97
|
+
"services": "Servicios",
|
|
98
|
+
"pricing": "Precios",
|
|
99
|
+
"more_help": "¿Necesitas algo más?",
|
|
100
|
+
},
|
|
101
|
+
demo={
|
|
102
|
+
"enter_name": "Ingresa tu nombre",
|
|
103
|
+
"enter_email": "Ingresa tu email",
|
|
104
|
+
"enter_phone": "Ingresa tu teléfono",
|
|
105
|
+
"ask_interest": "¿Qué te interesa?",
|
|
106
|
+
"schedule_demo": "Programar demo",
|
|
107
|
+
"demo_confirmed": "¡Demo confirmada! Te contactaremos pronto.",
|
|
108
|
+
"company_name": "Nombre de empresa",
|
|
109
|
+
"company_size": "Tamaño de empresa",
|
|
110
|
+
},
|
|
111
|
+
admin={
|
|
112
|
+
"welcome_admin": "Panel de Administración",
|
|
113
|
+
"total_instances": "Total de instancias",
|
|
114
|
+
"active_conversations": "Conversaciones activas",
|
|
115
|
+
"total_users": "Total de usuarios",
|
|
116
|
+
"system_health": "Salud del sistema",
|
|
117
|
+
"quick_actions": "Acciones rápidas",
|
|
118
|
+
"recent_activity": "Actividad reciente",
|
|
119
|
+
"settings": "Configuración",
|
|
120
|
+
"users": "Usuarios",
|
|
121
|
+
"billing": "Facturación",
|
|
122
|
+
"reports": "Reportes",
|
|
123
|
+
"security": "Seguridad",
|
|
124
|
+
},
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def _en() -> TranslationSet:
|
|
129
|
+
return TranslationSet(
|
|
130
|
+
ui={
|
|
131
|
+
"dashboard": "Dashboard",
|
|
132
|
+
"instances": "Instances",
|
|
133
|
+
"status": "Status",
|
|
134
|
+
"running": "Running",
|
|
135
|
+
"stopped": "Stopped",
|
|
136
|
+
"error": "Error",
|
|
137
|
+
"start": "Start",
|
|
138
|
+
"stop": "Stop",
|
|
139
|
+
"restart": "Restart",
|
|
140
|
+
"delete": "Delete",
|
|
141
|
+
"create": "Create",
|
|
142
|
+
"cancel": "Cancel",
|
|
143
|
+
"confirm": "Confirm",
|
|
144
|
+
"back": "Back",
|
|
145
|
+
"next": "Next",
|
|
146
|
+
"help": "Help",
|
|
147
|
+
"loading": "Loading...",
|
|
148
|
+
"success": "Success",
|
|
149
|
+
"warning": "Warning",
|
|
150
|
+
"language": "Language",
|
|
151
|
+
"select_language": "Select language",
|
|
152
|
+
"enter_number": "Enter a number",
|
|
153
|
+
"press_enter": "Press Enter",
|
|
154
|
+
"no_instances": "No instances",
|
|
155
|
+
"create_first": "Create your first instance",
|
|
156
|
+
"exit": "Exit",
|
|
157
|
+
"menu": "Menu",
|
|
158
|
+
"options": "Options",
|
|
159
|
+
"install": "Install",
|
|
160
|
+
"init": "Initialize",
|
|
161
|
+
"new": "New",
|
|
162
|
+
"list": "List",
|
|
163
|
+
"chat": "Chat",
|
|
164
|
+
"sync": "Sync",
|
|
165
|
+
"fix": "Fix",
|
|
166
|
+
"health": "Health",
|
|
167
|
+
"logs": "Logs",
|
|
168
|
+
"config": "Configure",
|
|
169
|
+
"guide": "Guide",
|
|
170
|
+
"doctor": "Doctor",
|
|
171
|
+
"upgrade": "Upgrade",
|
|
172
|
+
"metrics": "Metrics",
|
|
173
|
+
"stats": "Statistics",
|
|
174
|
+
"backup": "Backup",
|
|
175
|
+
"test": "Test",
|
|
176
|
+
"secure": "Security",
|
|
177
|
+
"welcome": "Welcome to Conny",
|
|
178
|
+
"enter_choice": "Enter your option",
|
|
179
|
+
},
|
|
180
|
+
bot={
|
|
181
|
+
"welcome": "Hello! 👋 I'm Conny, your virtual assistant. How can I help you today?",
|
|
182
|
+
"greeting": "Hi! How are you?",
|
|
183
|
+
"thanks": "Thanks for your trust!",
|
|
184
|
+
"goodbye": "It was a pleasure helping you. See you soon! 👋",
|
|
185
|
+
"processing": "Give me a moment...",
|
|
186
|
+
"typing": "Typing...",
|
|
187
|
+
"error_occurred": "Oops, something went wrong. Try again.",
|
|
188
|
+
"not_understood": "I didn't understand your message. Could you rephrase it?",
|
|
189
|
+
"menu": "Here are the options:",
|
|
190
|
+
"hours": "Business hours",
|
|
191
|
+
"location": "Location",
|
|
192
|
+
"contact": "Contact",
|
|
193
|
+
"appointment": "Book appointment",
|
|
194
|
+
"services": "Services",
|
|
195
|
+
"pricing": "Pricing",
|
|
196
|
+
"more_help": "Do you need anything else?",
|
|
197
|
+
},
|
|
198
|
+
demo={
|
|
199
|
+
"enter_name": "Enter your name",
|
|
200
|
+
"enter_email": "Enter your email",
|
|
201
|
+
"enter_phone": "Enter your phone",
|
|
202
|
+
"ask_interest": "What are you interested in?",
|
|
203
|
+
"schedule_demo": "Schedule demo",
|
|
204
|
+
"demo_confirmed": "Demo confirmed! We'll contact you soon.",
|
|
205
|
+
"company_name": "Company name",
|
|
206
|
+
"company_size": "Company size",
|
|
207
|
+
},
|
|
208
|
+
admin={
|
|
209
|
+
"welcome_admin": "Admin Panel",
|
|
210
|
+
"total_instances": "Total instances",
|
|
211
|
+
"active_conversations": "Active conversations",
|
|
212
|
+
"total_users": "Total users",
|
|
213
|
+
"system_health": "System health",
|
|
214
|
+
"quick_actions": "Quick actions",
|
|
215
|
+
"recent_activity": "Recent activity",
|
|
216
|
+
"settings": "Settings",
|
|
217
|
+
"users": "Users",
|
|
218
|
+
"billing": "Billing",
|
|
219
|
+
"reports": "Reports",
|
|
220
|
+
"security": "Security",
|
|
221
|
+
},
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def _pt() -> TranslationSet:
|
|
226
|
+
return TranslationSet(
|
|
227
|
+
ui={
|
|
228
|
+
"dashboard": "Painel",
|
|
229
|
+
"instances": "Instâncias",
|
|
230
|
+
"status": "Estado",
|
|
231
|
+
"running": "Executando",
|
|
232
|
+
"stopped": "Parada",
|
|
233
|
+
"error": "Erro",
|
|
234
|
+
"start": "Iniciar",
|
|
235
|
+
"stop": "Parar",
|
|
236
|
+
"restart": "Reiniciar",
|
|
237
|
+
"delete": "Excluir",
|
|
238
|
+
"create": "Criar",
|
|
239
|
+
"cancel": "Cancelar",
|
|
240
|
+
"confirm": "Confirmar",
|
|
241
|
+
"back": "Voltar",
|
|
242
|
+
"next": "Próximo",
|
|
243
|
+
"help": "Ajuda",
|
|
244
|
+
"loading": "Carregando...",
|
|
245
|
+
"success": "Sucesso",
|
|
246
|
+
"warning": "Aviso",
|
|
247
|
+
"language": "Idioma",
|
|
248
|
+
"select_language": "Selecionar idioma",
|
|
249
|
+
"enter_number": "Digite um número",
|
|
250
|
+
"press_enter": "Pressione Enter",
|
|
251
|
+
"no_instances": "Sem instâncias",
|
|
252
|
+
"create_first": "Crie sua primeira instância",
|
|
253
|
+
"exit": "Sair",
|
|
254
|
+
"menu": "Menu",
|
|
255
|
+
"options": "Opções",
|
|
256
|
+
"install": "Instalar",
|
|
257
|
+
"init": "Iniciar",
|
|
258
|
+
"new": "Nova",
|
|
259
|
+
"list": "Listar",
|
|
260
|
+
"chat": "Chat",
|
|
261
|
+
"sync": "Sincronizar",
|
|
262
|
+
"fix": "Corrigir",
|
|
263
|
+
"health": "Saúde",
|
|
264
|
+
"logs": "Logs",
|
|
265
|
+
"config": "Configurar",
|
|
266
|
+
"guide": "Guia",
|
|
267
|
+
"doctor": "Doutor",
|
|
268
|
+
"upgrade": "Atualizar",
|
|
269
|
+
"metrics": "Métricas",
|
|
270
|
+
"stats": "Estatísticas",
|
|
271
|
+
"backup": "Backup",
|
|
272
|
+
"test": "Testar",
|
|
273
|
+
"secure": "Segurança",
|
|
274
|
+
"welcome": "Bem-vindo ao Conny",
|
|
275
|
+
"enter_choice": "Digite sua opção",
|
|
276
|
+
},
|
|
277
|
+
bot={
|
|
278
|
+
"welcome": "Olá! 👋 Sou a Conny, sua assistente virtual. Como posso ajudar hoje?",
|
|
279
|
+
"greeting": "Oi! Como você está?",
|
|
280
|
+
"thanks": "Obrigado pela sua confiança!",
|
|
281
|
+
"goodbye": "Foi um prazer ajudar. Até logo! 👋",
|
|
282
|
+
"processing": "Me dê um momento...",
|
|
283
|
+
"typing": "Digitando...",
|
|
284
|
+
"error_occurred": "Ops, algo deu errado. Tente novamente.",
|
|
285
|
+
"not_understood": "Não entendi sua mensagem. Poderia reformular?",
|
|
286
|
+
"menu": "Aqui estão as opções:",
|
|
287
|
+
"hours": "Horário de funcionamento",
|
|
288
|
+
"location": "Localização",
|
|
289
|
+
"contact": "Contato",
|
|
290
|
+
"appointment": "Agendar consulta",
|
|
291
|
+
"services": "Serviços",
|
|
292
|
+
"pricing": "Preços",
|
|
293
|
+
"more_help": "Precisa de mais alguma coisa?",
|
|
294
|
+
},
|
|
295
|
+
demo={
|
|
296
|
+
"enter_name": "Digite seu nome",
|
|
297
|
+
"enter_email": "Digite seu email",
|
|
298
|
+
"enter_phone": "Digite seu telefone",
|
|
299
|
+
"ask_interest": "No que você tem interesse?",
|
|
300
|
+
"schedule_demo": "Agendar demo",
|
|
301
|
+
"demo_confirmed": "Demo confirmada! Entraremos em contato em breve.",
|
|
302
|
+
"company_name": "Nome da empresa",
|
|
303
|
+
"company_size": "Tamanho da empresa",
|
|
304
|
+
},
|
|
305
|
+
admin={
|
|
306
|
+
"welcome_admin": "Painel de Administração",
|
|
307
|
+
"total_instances": "Total de instâncias",
|
|
308
|
+
"active_conversations": "Conversas ativas",
|
|
309
|
+
"total_users": "Total de usuários",
|
|
310
|
+
"system_health": "Saúde do sistema",
|
|
311
|
+
"quick_actions": "Ações rápidas",
|
|
312
|
+
"recent_activity": "Atividade recente",
|
|
313
|
+
"settings": "Configurações",
|
|
314
|
+
"users": "Usuários",
|
|
315
|
+
"billing": "Faturamento",
|
|
316
|
+
"reports": "Relatórios",
|
|
317
|
+
"security": "Segurança",
|
|
318
|
+
},
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def _fr() -> TranslationSet:
|
|
323
|
+
return TranslationSet(
|
|
324
|
+
ui={
|
|
325
|
+
"dashboard": "Tableau de bord",
|
|
326
|
+
"instances": "Instances",
|
|
327
|
+
"status": "Statut",
|
|
328
|
+
"running": "En cours",
|
|
329
|
+
"stopped": "Arrêté",
|
|
330
|
+
"error": "Erreur",
|
|
331
|
+
"start": "Démarrer",
|
|
332
|
+
"stop": "Arrêter",
|
|
333
|
+
"restart": "Redémarrer",
|
|
334
|
+
"delete": "Supprimer",
|
|
335
|
+
"create": "Créer",
|
|
336
|
+
"cancel": "Annuler",
|
|
337
|
+
"confirm": "Confirmer",
|
|
338
|
+
"back": "Retour",
|
|
339
|
+
"next": "Suivant",
|
|
340
|
+
"help": "Aide",
|
|
341
|
+
"loading": "Chargement...",
|
|
342
|
+
"success": "Succès",
|
|
343
|
+
"warning": "Avertissement",
|
|
344
|
+
"language": "Langue",
|
|
345
|
+
"select_language": "Sélectionner la langue",
|
|
346
|
+
"enter_number": "Entrez un numéro",
|
|
347
|
+
"press_enter": "Appuyez sur Entrée",
|
|
348
|
+
"no_instances": "Aucune instance",
|
|
349
|
+
"create_first": "Créez votre première instance",
|
|
350
|
+
"exit": "Quitter",
|
|
351
|
+
"menu": "Menu",
|
|
352
|
+
"options": "Options",
|
|
353
|
+
"install": "Installer",
|
|
354
|
+
"init": "Initialiser",
|
|
355
|
+
"new": "Nouveau",
|
|
356
|
+
"list": "Lister",
|
|
357
|
+
"chat": "Chat",
|
|
358
|
+
"sync": "Synchroniser",
|
|
359
|
+
"fix": "Corriger",
|
|
360
|
+
"health": "Santé",
|
|
361
|
+
"logs": "Journaux",
|
|
362
|
+
"config": "Configurer",
|
|
363
|
+
"guide": "Guide",
|
|
364
|
+
"doctor": "Docteur",
|
|
365
|
+
"upgrade": "Mettre à jour",
|
|
366
|
+
"metrics": "Métriques",
|
|
367
|
+
"stats": "Statistiques",
|
|
368
|
+
"backup": "Sauvegarde",
|
|
369
|
+
"test": "Tester",
|
|
370
|
+
"secure": "Sécurité",
|
|
371
|
+
"welcome": "Bienvenue sur Conny",
|
|
372
|
+
"enter_choice": "Entrez votre option",
|
|
373
|
+
},
|
|
374
|
+
bot={
|
|
375
|
+
"welcome": "Bonjour! 👋 Je suis Conny, votre assistante virtuelle. Comment puis-je vous aider aujourd'hui?",
|
|
376
|
+
"greeting": "Salut! Comment allez-vous?",
|
|
377
|
+
"thanks": "Merci pour votre confiance!",
|
|
378
|
+
"goodbye": "Ce fut un plaisir de vous aider. À bientôt! 👋",
|
|
379
|
+
"processing": "Donnez-moi un moment...",
|
|
380
|
+
"typing": "En train d'écrire...",
|
|
381
|
+
"error_occurred": "Oups, quelque chose s'est mal passé. Réessayez.",
|
|
382
|
+
"not_understood": "Je n'ai pas compris votre message. Pourriez-vous le reformuler?",
|
|
383
|
+
"menu": "Voici les options:",
|
|
384
|
+
"hours": "Heures d'ouverture",
|
|
385
|
+
"location": "Emplacement",
|
|
386
|
+
"contact": "Contact",
|
|
387
|
+
"appointment": "Prendre rendez-vous",
|
|
388
|
+
"services": "Services",
|
|
389
|
+
"pricing": "Tarifs",
|
|
390
|
+
"more_help": "Avez-vous besoin d'autre chose?",
|
|
391
|
+
},
|
|
392
|
+
demo={
|
|
393
|
+
"enter_name": "Entrez votre nom",
|
|
394
|
+
"enter_email": "Entrez votre email",
|
|
395
|
+
"enter_phone": "Entrez votre téléphone",
|
|
396
|
+
"ask_interest": "Qu'est-ce qui vous intéresse?",
|
|
397
|
+
"schedule_demo": "Planifier une démo",
|
|
398
|
+
"demo_confirmed": "Démo confirmée! Nous vous contacterons bientôt.",
|
|
399
|
+
"company_name": "Nom de l'entreprise",
|
|
400
|
+
"company_size": "Taille de l'entreprise",
|
|
401
|
+
},
|
|
402
|
+
admin={
|
|
403
|
+
"welcome_admin": "Panneau d'administration",
|
|
404
|
+
"total_instances": "Total des instances",
|
|
405
|
+
"active_conversations": "Conversations actives",
|
|
406
|
+
"total_users": "Total des utilisateurs",
|
|
407
|
+
"system_health": "Santé du système",
|
|
408
|
+
"quick_actions": "Actions rapides",
|
|
409
|
+
"recent_activity": "Activité récente",
|
|
410
|
+
"settings": "Paramètres",
|
|
411
|
+
"users": "Utilisateurs",
|
|
412
|
+
"billing": "Facturation",
|
|
413
|
+
"reports": "Rapports",
|
|
414
|
+
"security": "Sécurité",
|
|
415
|
+
},
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
def _de() -> TranslationSet:
|
|
420
|
+
return TranslationSet(
|
|
421
|
+
ui={
|
|
422
|
+
"dashboard": "Dashboard",
|
|
423
|
+
"instances": "Instanzen",
|
|
424
|
+
"status": "Status",
|
|
425
|
+
"running": "Läuft",
|
|
426
|
+
"stopped": "Gestoppt",
|
|
427
|
+
"error": "Fehler",
|
|
428
|
+
"start": "Starten",
|
|
429
|
+
"stop": "Stoppen",
|
|
430
|
+
"restart": "Neustarten",
|
|
431
|
+
"delete": "Löschen",
|
|
432
|
+
"create": "Erstellen",
|
|
433
|
+
"cancel": "Abbrechen",
|
|
434
|
+
"confirm": "Bestätigen",
|
|
435
|
+
"back": "Zurück",
|
|
436
|
+
"next": "Weiter",
|
|
437
|
+
"help": "Hilfe",
|
|
438
|
+
"loading": "Laden...",
|
|
439
|
+
"success": "Erfolg",
|
|
440
|
+
"warning": "Warnung",
|
|
441
|
+
"language": "Sprache",
|
|
442
|
+
"select_language": "Sprache auswählen",
|
|
443
|
+
"enter_number": "Nummer eingeben",
|
|
444
|
+
"press_enter": "Enter drücken",
|
|
445
|
+
"no_instances": "Keine Instanzen",
|
|
446
|
+
"create_first": "Erstellen Sie Ihre erste Instanz",
|
|
447
|
+
"exit": "Beenden",
|
|
448
|
+
"menu": "Menü",
|
|
449
|
+
"options": "Optionen",
|
|
450
|
+
"install": "Installieren",
|
|
451
|
+
"init": "Initialisieren",
|
|
452
|
+
"new": "Neu",
|
|
453
|
+
"list": "Auflisten",
|
|
454
|
+
"chat": "Chat",
|
|
455
|
+
"sync": "Synchronisieren",
|
|
456
|
+
"fix": "Beheben",
|
|
457
|
+
"health": "Gesundheit",
|
|
458
|
+
"logs": "Protokolle",
|
|
459
|
+
"config": "Konfigurieren",
|
|
460
|
+
"guide": "Anleitung",
|
|
461
|
+
"doctor": "Doktor",
|
|
462
|
+
"upgrade": "Aktualisieren",
|
|
463
|
+
"metrics": "Metriken",
|
|
464
|
+
"stats": "Statistiken",
|
|
465
|
+
"backup": "Sicherung",
|
|
466
|
+
"test": "Testen",
|
|
467
|
+
"secure": "Sicherheit",
|
|
468
|
+
"welcome": "Willkommen bei Conny",
|
|
469
|
+
"enter_choice": "Option eingeben",
|
|
470
|
+
},
|
|
471
|
+
bot={
|
|
472
|
+
"welcome": "Hallo! 👋 Ich bin Conny, Ihre virtuelle Assistentin. Wie kann ich Ihnen heute helfen?",
|
|
473
|
+
"greeting": "Hi! Wie geht es Ihnen?",
|
|
474
|
+
"thanks": "Vielen Dank für Ihr Vertrauen!",
|
|
475
|
+
"goodbye": "Es war mir eine Freude zu helfen. Bis bald! 👋",
|
|
476
|
+
"processing": "Gib mir einen Moment...",
|
|
477
|
+
"typing": "Schreiben...",
|
|
478
|
+
"error_occurred": "Hoppla, etwas ist schief gelaufen. Versuchen Sie es erneut.",
|
|
479
|
+
"not_understood": "Ich habe Ihre Nachricht nicht verstanden. Könnten Sie sie umformulieren?",
|
|
480
|
+
"menu": "Hier sind die Optionen:",
|
|
481
|
+
"hours": "Öffnungszeiten",
|
|
482
|
+
"location": "Standort",
|
|
483
|
+
"contact": "Kontakt",
|
|
484
|
+
"appointment": "Termin buchen",
|
|
485
|
+
"services": "Dienstleistungen",
|
|
486
|
+
"pricing": "Preise",
|
|
487
|
+
"more_help": "Brauchen Sie noch etwas?",
|
|
488
|
+
},
|
|
489
|
+
demo={
|
|
490
|
+
"enter_name": "Geben Sie Ihren Namen ein",
|
|
491
|
+
"enter_email": "Geben Sie Ihre E-Mail ein",
|
|
492
|
+
"enter_phone": "Geben Sie Ihre Telefonnummer ein",
|
|
493
|
+
"ask_interest": "Was interessiert Sie?",
|
|
494
|
+
"schedule_demo": "Demo planen",
|
|
495
|
+
"demo_confirmed": "Demo bestätigt! Wir werden Sie bald kontaktieren.",
|
|
496
|
+
"company_name": "Firmenname",
|
|
497
|
+
"company_size": "Unternehmensgröße",
|
|
498
|
+
},
|
|
499
|
+
admin={
|
|
500
|
+
"welcome_admin": "Admin-Panel",
|
|
501
|
+
"total_instances": "Gesamte Instanzen",
|
|
502
|
+
"active_conversations": "Aktive Gespräche",
|
|
503
|
+
"total_users": "Gesamte Benutzer",
|
|
504
|
+
"system_health": "Systemzustand",
|
|
505
|
+
"quick_actions": "Schnellaktionen",
|
|
506
|
+
"recent_activity": "Letzte Aktivität",
|
|
507
|
+
"settings": "Einstellungen",
|
|
508
|
+
"users": "Benutzer",
|
|
509
|
+
"billing": "Abrechnung",
|
|
510
|
+
"reports": "Berichte",
|
|
511
|
+
"security": "Sicherheit",
|
|
512
|
+
},
|
|
513
|
+
)
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
_TRANSLATIONS: Dict[str, TranslationSet] = {
|
|
517
|
+
"es": _es(),
|
|
518
|
+
"en": _en(),
|
|
519
|
+
"pt": _pt(),
|
|
520
|
+
"fr": _fr(),
|
|
521
|
+
"de": _de(),
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
class I18n:
|
|
526
|
+
def __init__(self, lang: str = DEFAULT_LANGUAGE):
|
|
527
|
+
self.lang = lang if lang in _TRANSLATIONS else DEFAULT_LANGUAGE
|
|
528
|
+
self._cache: Dict[str, str] = {}
|
|
529
|
+
|
|
530
|
+
def t(self, key: str, category: str = "ui") -> str:
|
|
531
|
+
cache_key = f"{self.lang}:{category}:{key}"
|
|
532
|
+
if cache_key in self._cache:
|
|
533
|
+
return self._cache[cache_key]
|
|
534
|
+
|
|
535
|
+
translations = _TRANSLATIONS.get(self.lang)
|
|
536
|
+
if translations is None:
|
|
537
|
+
translations = _TRANSLATIONS[DEFAULT_LANGUAGE]
|
|
538
|
+
|
|
539
|
+
category_dict = getattr(translations, category, {})
|
|
540
|
+
result = category_dict.get(key, key)
|
|
541
|
+
self._cache[cache_key] = result
|
|
542
|
+
return result
|
|
543
|
+
|
|
544
|
+
def ui(self, key: str) -> str:
|
|
545
|
+
return self.t(key, "ui")
|
|
546
|
+
|
|
547
|
+
def bot(self, key: str) -> str:
|
|
548
|
+
return self.t(key, "bot")
|
|
549
|
+
|
|
550
|
+
def demo(self, key: str) -> str:
|
|
551
|
+
return self.t(key, "demo")
|
|
552
|
+
|
|
553
|
+
def admin(self, key: str) -> str:
|
|
554
|
+
return self.t(key, "admin")
|
|
555
|
+
|
|
556
|
+
def set_lang(self, lang: str) -> None:
|
|
557
|
+
if lang in _TRANSLATIONS:
|
|
558
|
+
self.lang = lang
|
|
559
|
+
self._cache.clear()
|
|
560
|
+
|
|
561
|
+
@property
|
|
562
|
+
def current_lang(self) -> str:
|
|
563
|
+
return self.lang
|
|
564
|
+
|
|
565
|
+
@property
|
|
566
|
+
def available_languages(self) -> Dict[str, str]:
|
|
567
|
+
return SUPPORTED_LANGUAGES.copy()
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
_global_i18n: I18n = I18n()
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
def get_i18n() -> I18n:
|
|
574
|
+
return _global_i18n
|
|
575
|
+
|
|
576
|
+
|
|
577
|
+
def set_language(lang: str) -> None:
|
|
578
|
+
_global_i18n.set_lang(lang)
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
def t(key: str, category: str = "ui") -> str:
|
|
582
|
+
return _global_i18n.t(key, category)
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
def detect_user_language(text: str) -> str:
|
|
586
|
+
text_lower = text.lower()
|
|
587
|
+
|
|
588
|
+
spanish_indicators = ["hola", "gracias", "buenos", "cómo", "quiero", "necesito", "hablar", "dónde", "cuándo", "cuánto"]
|
|
589
|
+
english_indicators = ["hello", "thanks", "hi", "how", "want", "need", "speak", "where", "when", "how much"]
|
|
590
|
+
portuguese_indicators = ["oi", "obrigado", "ola", "como", "quero", "preciso", "falar", "onde", "quando", "quanto"]
|
|
591
|
+
french_indicators = ["bonjour", "merci", "salut", "comment", "vouloir", "besoin", "parler", "où", "quand", "combien"]
|
|
592
|
+
german_indicators = ["hallo", "danke", "hi", "wie", "wollen", "brauchen", "sprechen", "wo", "wann", "wie viel"]
|
|
593
|
+
|
|
594
|
+
for word in spanish_indicators:
|
|
595
|
+
if word in text_lower:
|
|
596
|
+
return "es"
|
|
597
|
+
for word in english_indicators:
|
|
598
|
+
if word in text_lower:
|
|
599
|
+
return "en"
|
|
600
|
+
for word in portuguese_indicators:
|
|
601
|
+
if word in text_lower:
|
|
602
|
+
return "pt"
|
|
603
|
+
for word in french_indicators:
|
|
604
|
+
if word in text_lower:
|
|
605
|
+
return "fr"
|
|
606
|
+
for word in german_indicators:
|
|
607
|
+
if word in text_lower:
|
|
608
|
+
return "de"
|
|
609
|
+
|
|
610
|
+
return DEFAULT_LANGUAGE
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
LANGUAGE_MENU = {
|
|
614
|
+
"es": "🇪🇸 Español",
|
|
615
|
+
"en": "🇬🇧 English",
|
|
616
|
+
"pt": "🇧🇷 Português",
|
|
617
|
+
"fr": "🇫🇷 Français",
|
|
618
|
+
"de": "🇩🇪 Deutsch",
|
|
619
|
+
}
|