From b539c92daf75ad1cb17156a80685c5f81b4231d9 Mon Sep 17 00:00:00 2001
From: consultoria-as
Date: Tue, 30 Jun 2026 18:13:43 +0000
Subject: [PATCH] feat(i18n): force Spanish as the only language across all
tenants
- i18n.js now locks currentLang to 'es' and overwrites pos_lang in localStorage.
- Disabled setLang language switching.
- Removed ES/EN toggle from sidebar.
- Bumped i18n.js and sidebar.js cache version on all templates.
---
pos/static/js/i18n.js | 11 ++++++-----
pos/static/js/sidebar.js | 12 ------------
pos/templates/accounting.html | 4 ++--
pos/templates/catalog.html | 4 ++--
pos/templates/config.html | 4 ++--
pos/templates/customers.html | 4 ++--
pos/templates/dashboard.html | 4 ++--
pos/templates/diagrams.html | 4 ++--
pos/templates/fleet.html | 4 ++--
pos/templates/inventory.html | 4 ++--
pos/templates/invoicing.html | 4 ++--
pos/templates/marketplace_external.html | 4 ++--
pos/templates/pos.html | 2 +-
pos/templates/quotations.html | 4 ++--
pos/templates/reports.html | 4 ++--
pos/templates/supplier_catalog.html | 2 +-
pos/templates/whatsapp.html | 4 ++--
pos/templates/workshop.html | 4 ++--
18 files changed, 36 insertions(+), 47 deletions(-)
diff --git a/pos/static/js/i18n.js b/pos/static/js/i18n.js
index ed28ee4..694a0f4 100644
--- a/pos/static/js/i18n.js
+++ b/pos/static/js/i18n.js
@@ -317,7 +317,9 @@ var I18N = {
}
};
-var currentLang = localStorage.getItem('pos_lang') || 'es';
+// Spanish is mandatory for all tenants; ignore any previously stored language.
+var currentLang = 'es';
+localStorage.setItem('pos_lang', 'es');
/**
* Translate a key to the current language.
@@ -328,12 +330,11 @@ window.t = function(key) {
};
/**
- * Switch the UI language and reload.
+ * Language switcher is disabled; the system stays in Spanish.
*/
window.setLang = function(lang) {
- currentLang = lang;
- localStorage.setItem('pos_lang', lang);
- location.reload();
+ currentLang = 'es';
+ localStorage.setItem('pos_lang', 'es');
};
/**
diff --git a/pos/static/js/sidebar.js b/pos/static/js/sidebar.js
index 8614798..c998174 100644
--- a/pos/static/js/sidebar.js
+++ b/pos/static/js/sidebar.js
@@ -15,7 +15,6 @@ window.renderSidebar = function(modulesOverride) {
var initials = u.initials || '?';
var currentPath = window.location.pathname;
var currentTheme = localStorage.getItem('pos_theme') || 'industrial';
- var currentLang = localStorage.getItem('pos_lang') || 'es';
var modules = {};
if (modulesOverride && typeof modulesOverride === 'object') {
@@ -104,16 +103,6 @@ window.renderSidebar = function(modulesOverride) {
+ ''
+ '';
- // Language toggle buttons
- var langHtml = '';
-
window.updateThemeButtons = function() {
var t = localStorage.getItem('pos_theme') || 'industrial';
document.querySelectorAll('.theme-toggle-btn').forEach(function(b, i) {
@@ -131,7 +120,6 @@ window.renderSidebar = function(modulesOverride) {
+ ''
+ ''
+ themeHtml
- + langHtml
+ '
-
+
-
+
diff --git a/pos/templates/catalog.html b/pos/templates/catalog.html
index b5416ab..9bbdc4e 100644
--- a/pos/templates/catalog.html
+++ b/pos/templates/catalog.html
@@ -314,12 +314,12 @@
-
+
-
+
diff --git a/pos/templates/config.html b/pos/templates/config.html
index 864e274..ab12c64 100644
--- a/pos/templates/config.html
+++ b/pos/templates/config.html
@@ -922,11 +922,11 @@
-
+
-
+
diff --git a/pos/templates/customers.html b/pos/templates/customers.html
index 604d211..39e5b6c 100644
--- a/pos/templates/customers.html
+++ b/pos/templates/customers.html
@@ -633,11 +633,11 @@
-
+
-
+
diff --git a/pos/templates/dashboard.html b/pos/templates/dashboard.html
index bd83d50..dd02d09 100644
--- a/pos/templates/dashboard.html
+++ b/pos/templates/dashboard.html
@@ -595,11 +595,11 @@
-
+
-
+
diff --git a/pos/templates/diagrams.html b/pos/templates/diagrams.html
index d9fc58f..58018b1 100644
--- a/pos/templates/diagrams.html
+++ b/pos/templates/diagrams.html
@@ -148,12 +148,12 @@
-
+
-
+
diff --git a/pos/templates/fleet.html b/pos/templates/fleet.html
index cc3a573..be439a0 100644
--- a/pos/templates/fleet.html
+++ b/pos/templates/fleet.html
@@ -302,11 +302,11 @@
-
+
-
+
diff --git a/pos/templates/inventory.html b/pos/templates/inventory.html
index 28bf9c3..3967057 100644
--- a/pos/templates/inventory.html
+++ b/pos/templates/inventory.html
@@ -1052,11 +1052,11 @@
-
+
-
+
diff --git a/pos/templates/invoicing.html b/pos/templates/invoicing.html
index 0e1ad87..9beb5fd 100644
--- a/pos/templates/invoicing.html
+++ b/pos/templates/invoicing.html
@@ -1063,11 +1063,11 @@
-
+
-
+
diff --git a/pos/templates/marketplace_external.html b/pos/templates/marketplace_external.html
index 1fbb579..987da8e 100644
--- a/pos/templates/marketplace_external.html
+++ b/pos/templates/marketplace_external.html
@@ -342,11 +342,11 @@
-
+
-
+
-
+
-
+
Cotizaciones
diff --git a/pos/templates/reports.html b/pos/templates/reports.html
index ec4e66c..4479a8d 100644
--- a/pos/templates/reports.html
+++ b/pos/templates/reports.html
@@ -365,11 +365,11 @@
-
+
-
+
diff --git a/pos/templates/supplier_catalog.html b/pos/templates/supplier_catalog.html
index 86a7737..3a4395e 100644
--- a/pos/templates/supplier_catalog.html
+++ b/pos/templates/supplier_catalog.html
@@ -127,7 +127,7 @@
-
+