Răsfoiți Sursa

Merge pull request #126 from kaelthasmanu/fix_some_translations

## fix some translations
Manuel Gorrin 2 săptămâni în urmă
părinte
comite
14d9200e64

+ 2 - 2
requirements.txt

@@ -140,11 +140,11 @@ rsa==4.9.1
     # via telethon
 simple-websocket==1.1.0
     # via python-engineio
-sqlalchemy==2.1.8
+sqlalchemy==2.1.9
     # via
     #   -r requirements.in
     #   alembic
-telethon==1.45.0
+telethon==1.46.0
     # via -r requirements.in
 tinycss2==1.5.1
     # via

+ 2 - 2
static/js/auditoria/renderers.js

@@ -110,7 +110,7 @@
       data:{
         labels:domains.map(d=>d.domain),
         datasets:[{
-          label:'Requests',
+          label: i18n.requestsLabel || 'Peticiones',
           data:domains.map(d=>d.count),
           backgroundColor:generateColors(domains.length)
         }]
@@ -160,7 +160,7 @@
       data:{
         labels:responses.map(r=>`HTTP ${r.code}`),
         datasets:[{
-          label:'Respuestas',
+          label: i18n.responsesLabel || 'Respuestas',
             data:responses.map(r=>r.count),
             backgroundColor:responses.map(r=>getResponseColor(r.code)),
             borderWidth:1

+ 4 - 4
static/js/reports-charts.js

@@ -153,7 +153,7 @@ document.addEventListener("DOMContentLoaded", function () {
         datasets: [
           {
             type: "bar",
-            label: "Peticiones",
+            label: chartData.chartLabels.requests,
             data: payload.requests || [],
             yAxisID: "requests",
             backgroundColor: "#3B82F6B3",
@@ -201,7 +201,7 @@ document.addEventListener("DOMContentLoaded", function () {
           requests: {
             position: "left",
             beginAtZero: true,
-            title: { display: true, text: "Peticiones", color: getTextColor() },
+            title: { display: true, text: chartData.chartLabels.requests, color: getTextColor() },
             ticks: { color: getTextColor(), precision: 0 },
           },
           data: {
@@ -221,10 +221,10 @@ document.addEventListener("DOMContentLoaded", function () {
   buildBarChart(
     "usersActivityChart",
     chartData.usersActivity,
-    "Número de Visitas",
+    chartData.chartLabels.numberOfVisits,
     ""
   );
-  buildBarChart("usersDataChart", chartData.usersData, "Datos (MB)", "MB");
+  buildBarChart("usersDataChart", chartData.usersData, chartData.chartLabels.dataMb, "MB");
   buildHourlyActivityChart(chartData.hourlyActivity);
   buildPieChart("httpCodesChart", chartData.httpCodes);
   buildPieChart("countriesChart", chartData.countries);

+ 1 - 2
static/js/reports-datepicker.js

@@ -68,11 +68,10 @@
       "d",
       "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
     );
-
     svg.appendChild(circle);
     svg.appendChild(path);
     btn.appendChild(svg);
-    btn.appendChild(document.createTextNode(" Cargando..."));
+    btn.appendChild(document.createTextNode(` ${btn.dataset.loadingLabel}`));
 
     // Validate dateVal format (YYYY-MM-DD) before navigation to avoid unexpected input
     const dateRegex = /^\d{4}-\d{2}-\d{2}$/;

+ 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 }}

+ 24 - 0
translations/de/sources/12_base_ui.po

@@ -879,6 +879,30 @@ msgstr "SWAP Belegt"
 msgid "SWAP Usada: "
 msgstr "SWAP Belegt: "
 
+#: templates/cacheView.html
+msgid "Uso de CPU (%)"
+msgstr "CPU-Auslastung (%)"
+
+#: templates/cacheView.html
+msgid "RAM Usada"
+msgstr "Belegter RAM"
+
+#: templates/cacheView.html
+msgid "RAM Usada: "
+msgstr "Belegter RAM: "
+
+#: templates/cacheView.html
+msgid "Subida (Mbps)"
+msgstr "Upload (Mbit/s)"
+
+#: templates/cacheView.html
+msgid "Bajada (Mbps)"
+msgstr "Download (Mbit/s)"
+
+#: templates/auditor.html
+msgid "Respuestas"
+msgstr "Antworten"
+
 msgid "Instalación .deb detectada."
 msgstr ".deb-Paketinstallation erkannt."
 

+ 24 - 0
translations/en/sources/12_base_ui.po

@@ -881,6 +881,30 @@ msgstr "Swap Used"
 msgid "SWAP Usada: "
 msgstr "SWAP Used: "
 
+#: templates/cacheView.html
+msgid "Uso de CPU (%)"
+msgstr "CPU Usage (%)"
+
+#: templates/cacheView.html
+msgid "RAM Usada"
+msgstr "RAM Used"
+
+#: templates/cacheView.html
+msgid "RAM Usada: "
+msgstr "RAM Used: "
+
+#: templates/cacheView.html
+msgid "Subida (Mbps)"
+msgstr "Upload (Mbps)"
+
+#: templates/cacheView.html
+msgid "Bajada (Mbps)"
+msgstr "Download (Mbps)"
+
+#: templates/auditor.html
+msgid "Respuestas"
+msgstr "Responses"
+
 msgid "Instalación .deb detectada."
 msgstr "Deb package installation detected."
 

+ 24 - 0
translations/ru/sources/12_base_ui.po

@@ -775,6 +775,30 @@ msgstr "Подержанный своп"
 msgid "SWAP Usada: "
 msgstr "Подержанный SWAP: "
 
+#: templates/cacheView.html
+msgid "Uso de CPU (%)"
+msgstr "Использование процессора (%)"
+
+#: templates/cacheView.html
+msgid "RAM Usada"
+msgstr "Используемая оперативная память"
+
+#: templates/cacheView.html
+msgid "RAM Usada: "
+msgstr "Используемая оперативная память: "
+
+#: templates/cacheView.html
+msgid "Subida (Mbps)"
+msgstr "Отправка (Мбит/с)"
+
+#: templates/cacheView.html
+msgid "Bajada (Mbps)"
+msgstr "Загрузка (Мбит/с)"
+
+#: templates/auditor.html
+msgid "Respuestas"
+msgstr "Ответы"
+
 msgid "Instalación .deb detectada."
 msgstr "Обнаружен пакет .deb."