Răsfoiți Sursa

fix(translations): enhance localization for chart labels and button loading text

Manuel 2 săptămâni în urmă
părinte
comite
8128ca41fc
3 a modificat fișierele cu 13 adăugiri și 5 ștergeri
  1. 2 0
      templates/auditor.html
  2. 5 5
      templates/cacheView.html
  3. 6 0
      templates/reports.html

+ 2 - 0
templates/auditor.html

@@ -120,6 +120,8 @@
             top10IpsByDataTitle: "{{ _('Top 10 IPs por Consumo de Datos') }}",
             ipCol: "{{ _('IP') }}",
             requestsPerHourLabel: "{{ _('Peticiones por Hora') }}",
+            requestsLabel: "{{ _('Peticiones') }}",
+            responsesLabel: "{{ _('Respuestas') }}",
             timeOfDayAxis: "{{ _('Hora del Día') }}",
             numberOfRequestsAxis: "{{ _('Número de Peticiones') }}",
             totalDataConsumedTitle: "{{ _('Total de Datos Consumidos del {startDate} al {endDate}') }}",

+ 5 - 5
templates/cacheView.html

@@ -198,7 +198,7 @@
         labels: [],
         datasets: [
           {
-            label: "Uso de CPU (%)",
+            label: {{ _("Uso de CPU (%)") | tojson }},
             data: [],
             borderColor: "#ef4444",
             backgroundColor: "rgba(239, 68, 68, 0.1)",
@@ -224,7 +224,7 @@
         labels: [],
         datasets: [
           {
-            label: "RAM Usada",
+            label: {{ _("RAM Usada") | tojson }},
             data: [],
             borderColor: "#3b82f6",
             backgroundColor: "rgba(59, 130, 246, 0.1)",
@@ -246,7 +246,7 @@
           ...chartOptions.plugins,
           tooltip: {
             callbacks: {
-              label: (ctx) => "RAM Usada: " + formatSizeCompact(ctx.raw),
+              label: (ctx) => {{ _("RAM Usada: ") | tojson }} + formatSizeCompact(ctx.raw),
             },
           },
         },
@@ -292,14 +292,14 @@
         labels: [],
         datasets: [
           {
-            label: "Subida (Mbps)",
+            label: {{ _("Subida (Mbps)") | tojson }},
             data: [],
             borderColor: "#06b6d4",
             backgroundColor: "rgba(6,182,212,0.1)",
             pointBackgroundColor: "#06b6d4",
           },
           {
-            label: "Bajada (Mbps)",
+            label: {{ _("Bajada (Mbps)") | tojson }},
             data: [],
             borderColor: "#f59e42",
             backgroundColor: "rgba(245,158,66,0.1)",

+ 6 - 0
templates/reports.html

@@ -20,6 +20,7 @@
 
         <button
           id="reports-go"
+          data-loading-label="{{ _('Cargando...') }}"
           class="inline-flex items-center justify-center px-2 py-1 border border-transparent text-xs xs:text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed"
         >
           <svg xmlns="http://www.w3.org/2000/svg" class="h-3 w-3 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
@@ -59,6 +60,11 @@
      and all JS behaviour lives in the external reports-charts.js file. #}
   <script type="application/json" id="chart-data">
     {
+      "chartLabels": {
+        "numberOfVisits": {{ _("Número de Visitas") | tojson | safe }},
+        "requests": {{ _("Peticiones") | tojson | safe }},
+        "dataMb": {{ _("Datos (MB)") | tojson | safe }}
+      },
       "usersActivity": {
         "labels": {{ metrics.top_users_by_activity | map(attribute='username') | list | tojson | safe }},
         "data":   {{ metrics.top_users_by_activity | map(attribute='total_visits') | list | tojson | safe }}