Fix: Translate all validation messages and UI text from Portuguese to English

This commit is contained in:
2025-09-25 20:08:13 -03:00
parent 2d0c086df2
commit 89a7ee41de
10 changed files with 248 additions and 154 deletions

View File

@@ -38,10 +38,10 @@ class K8sClient:
self.apps_v1 = client.AppsV1Api()
self.initialized = True
logger.info("Cliente Kubernetes inicializado com sucesso")
logger.info("Kubernetes client initialized successfully")
except Exception as e:
logger.error(f"Erro ao inicializar cliente Kubernetes: {e}")
logger.error(f"Error initializing Kubernetes client: {e}")
raise
def _is_system_namespace(self, namespace: str, include_system: bool = None) -> bool:
@@ -60,7 +60,7 @@ class K8sClient:
async def get_all_pods(self, include_system_namespaces: bool = None) -> List[PodResource]:
"""Coletar informações de todos os pods do cluster"""
if not self.initialized:
raise RuntimeError("Cliente Kubernetes não inicializado")
raise RuntimeError("Kubernetes client not initialized")
pods_data = []
@@ -110,13 +110,13 @@ class K8sClient:
return pods_data
except ApiException as e:
logger.error(f"Erro ao listar pods: {e}")
logger.error(f"Error listing pods: {e}")
raise
async def get_namespace_resources(self, namespace: str) -> NamespaceResources:
"""Coletar recursos de um namespace específico"""
if not self.initialized:
raise RuntimeError("Cliente Kubernetes não inicializado")
raise RuntimeError("Kubernetes client not initialized")
# Verificar se é namespace do sistema
if self._is_system_namespace(namespace):
@@ -179,13 +179,13 @@ class K8sClient:
return namespace_resource
except ApiException as e:
logger.error(f"Erro ao coletar recursos do namespace {namespace}: {e}")
logger.error(f"Error collecting resources for namespace {namespace}: {e}")
raise
async def get_vpa_recommendations(self) -> List[VPARecommendation]:
"""Coletar recomendações do VPA"""
if not self.initialized:
raise RuntimeError("Cliente Kubernetes não inicializado")
raise RuntimeError("Kubernetes client not initialized")
recommendations = []
@@ -199,14 +199,14 @@ class K8sClient:
return recommendations
except ApiException as e:
logger.error(f"Erro ao coletar recomendações VPA: {e}")
logger.error(f"Error collecting VPA recommendations: {e}")
# VPA pode não estar instalado, retornar lista vazia
return []
async def get_nodes_info(self) -> List[Dict[str, Any]]:
"""Coletar informações dos nós do cluster"""
if not self.initialized:
raise RuntimeError("Cliente Kubernetes não inicializado")
raise RuntimeError("Kubernetes client not initialized")
try:
nodes = self.v1.list_node()
@@ -250,5 +250,5 @@ class K8sClient:
return nodes_info
except ApiException as e:
logger.error(f"Erro ao coletar informações dos nós: {e}")
logger.error(f"Error collecting node information: {e}")
raise