@iotready/nextjs-components-library 1.0.0-preview39 → 1.0.0-preview40

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.
@@ -0,0 +1,92 @@
1
+ {
2
+ "library": {
3
+ "groupsDevices": {
4
+ "noDevices": "No devices",
5
+ "noDevicesInGroup": "No devices in {{entity}}",
6
+ "addDevices": "Add devices",
7
+ "filterReturnsNoResult": "Filter returns no result",
8
+ "list": "List",
9
+ "map": "Map",
10
+ "allDevices": "All devices",
11
+ "group": "Group",
12
+ "organization": "Organization",
13
+ "createGroup": "Create {{entity}}",
14
+ "backToGroup": "Back to {{entity}}",
15
+ "addToGroup": "Add to group",
16
+ "manageGroup": "Manage {{entity}}",
17
+ "removeFromGroup": "Remove from {{entity}}",
18
+ "closeEdit": "Close edit",
19
+ "editGroup": "Edit {{entity}}",
20
+ "newGroup": "New {{entity}}",
21
+ "groupName": "{{entity}} Name",
22
+ "description": "Description",
23
+ "cancel": "Cancel",
24
+ "create": "Create"
25
+ },
26
+ "groupUpdate": {
27
+ "name": "Name",
28
+ "description": "Description",
29
+ "update": "Update",
30
+ "addMembers": "Add members",
31
+ "noMembersFound": "No members found",
32
+ "selectUser": "Select user",
33
+ "add": "Add",
34
+ "deleteGroup": "Delete {{entity}}",
35
+ "actionCannotBeUndone": "This action cannot be undone",
36
+ "mustRemoveDevicesAndMembers": "You must manually remove devices and members from {{entity}} before deletion",
37
+ "mustRemoveDevicesMembersAndGroups": "You must manually remove devices, members and groups from {{entity}} before deletion",
38
+ "confirmDeleteGroup": "Are you sure you want to delete the {{entity}}?",
39
+ "yesRemoveIt": "Yes, remove it"
40
+ },
41
+ "usersDataGrid": {
42
+ "filterBy": "Filter by",
43
+ "search": "Search...",
44
+ "emailAddress": "Email Address",
45
+ "fullName": "Full name",
46
+ "role": "Role"
47
+ },
48
+ "accountMenu": {
49
+ "manageAccount": "Manage account",
50
+ "signOut": "Sign Out",
51
+ "openMenu": "Open menu"
52
+ },
53
+ "accountProfile": {
54
+ "completeInfo": "Please complete the informations below",
55
+ "profileName": "Profile name",
56
+ "firstName": "First name",
57
+ "enterFirstName": "Enter your first name",
58
+ "lastName": "Last name",
59
+ "enterLastName": "Enter your last name",
60
+ "update": "Update",
61
+ "security": "Security",
62
+ "setOrEditPassword": "Set or edit your password",
63
+ "newPassword": "New Password",
64
+ "confirmPassword": "Confirm Password",
65
+ "cancel": "Cancel",
66
+ "save": "Save",
67
+ "deleteAccount": "Delete account",
68
+ "actionCannotBeUndone": "This action cannot be undone",
69
+ "confirmDeleteAccount": "Are you sure you want to delete the account?",
70
+ "yesRemove": "Yes, remove",
71
+ "passwordRequired": "Password is required",
72
+ "confirmPasswordRequired": "Confirm password is required",
73
+ "passwordsMustMatch": "Password and Confirmation password must be the same",
74
+ "passwordUpdated": "Password updated",
75
+ "userUpdated": "User updated",
76
+ "passwordRequirements": "Password must be longer than 8 characters and must contain 1 uppercase letter (A-Z), 1 lowercase letter (a-z), 1 digit (0-9) e 1 special symbol (!\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~ )."
77
+ },
78
+ "userUpdate": {
79
+ "role": "Role",
80
+ "update": "Update"
81
+ },
82
+ "trendChart": {
83
+ "export": "Export",
84
+ "noDataMeasure": "No data measure",
85
+ "connectPointValues": "Connect point values",
86
+ "showAnnotations": "Show annotations"
87
+ },
88
+ "map": {
89
+ "noPositionsForDevices": "No positions for devices"
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,4 @@
1
+ import it from './it.json';
2
+ import en from './en.json';
3
+
4
+ export { en, it };
@@ -0,0 +1,92 @@
1
+ {
2
+ "library": {
3
+ "groupsDevices": {
4
+ "noDevices": "Nessun dispositivo",
5
+ "noDevicesInGroup": "Nessun dispositivo nel {{entity}}",
6
+ "addDevices": "Aggiungi dispositivi",
7
+ "filterReturnsNoResult": "Il filtro non restituisce risultati",
8
+ "list": "Lista",
9
+ "map": "Mappa",
10
+ "allDevices": "Tutti i dispositivi",
11
+ "group": "Gruppo",
12
+ "organization": "Organizzazione",
13
+ "createGroup": "Crea {{entity}}",
14
+ "backToGroup": "Torna al {{entity}}",
15
+ "addToGroup": "Aggiungi al gruppo",
16
+ "manageGroup": "Gestisci {{entity}}",
17
+ "removeFromGroup": "Rimuovi dal {{entity}}",
18
+ "closeEdit": "Chiudi modifica",
19
+ "editGroup": "Modifica {{entity}}",
20
+ "newGroup": "Nuovo {{entity}}",
21
+ "groupName": "Nome {{entity}}",
22
+ "description": "Descrizione",
23
+ "cancel": "Annulla",
24
+ "create": "Crea"
25
+ },
26
+ "groupUpdate": {
27
+ "name": "Nome",
28
+ "description": "Descrizione",
29
+ "update": "Aggiorna",
30
+ "addMembers": "Aggiungi membri",
31
+ "noMembersFound": "Nessun membro trovato",
32
+ "selectUser": "Seleziona utente",
33
+ "add": "Aggiungi",
34
+ "deleteGroup": "Elimina {{entity}}",
35
+ "actionCannotBeUndone": "Questa azione non può essere annullata",
36
+ "mustRemoveDevicesAndMembers": "Devi rimuovere manualmente i dispositivi e i membri dal {{entity}} prima dell'eliminazione",
37
+ "mustRemoveDevicesMembersAndGroups": "Devi rimuovere manualmente i dispositivi, i membri e i gruppi dal {{entity}} prima dell'eliminazione",
38
+ "confirmDeleteGroup": "Sei sicuro di voler eliminare il {{entity}}?",
39
+ "yesRemoveIt": "Sì, rimuovi"
40
+ },
41
+ "usersDataGrid": {
42
+ "filterBy": "Filtra per",
43
+ "search": "Cerca...",
44
+ "emailAddress": "Indirizzo email",
45
+ "fullName": "Nome completo",
46
+ "role": "Ruolo"
47
+ },
48
+ "accountMenu": {
49
+ "manageAccount": "Gestisci account",
50
+ "signOut": "Esci",
51
+ "openMenu": "Apri menu"
52
+ },
53
+ "accountProfile": {
54
+ "completeInfo": "Completa le informazioni qui sotto",
55
+ "profileName": "Nome profilo",
56
+ "firstName": "Nome",
57
+ "enterFirstName": "Inserisci il tuo nome",
58
+ "lastName": "Cognome",
59
+ "enterLastName": "Inserisci il tuo cognome",
60
+ "update": "Aggiorna",
61
+ "security": "Sicurezza",
62
+ "setOrEditPassword": "Imposta o modifica la tua password",
63
+ "newPassword": "Nuova Password",
64
+ "confirmPassword": "Conferma Password",
65
+ "cancel": "Annulla",
66
+ "save": "Salva",
67
+ "deleteAccount": "Elimina account",
68
+ "actionCannotBeUndone": "Questa azione non può essere annullata",
69
+ "confirmDeleteAccount": "Sei sicuro di voler eliminare l'account?",
70
+ "yesRemove": "Sì, rimuovi",
71
+ "passwordRequired": "La password è obbligatoria",
72
+ "confirmPasswordRequired": "La conferma della password è obbligatoria",
73
+ "passwordsMustMatch": "La password e la conferma della password devono essere uguali",
74
+ "passwordUpdated": "Password aggiornata",
75
+ "userUpdated": "Utente aggiornato",
76
+ "passwordRequirements": "La password deve essere più lunga di 8 caratteri e deve contenere 1 lettera maiuscola (A-Z), 1 lettera minuscola (a-z), 1 cifra (0-9) e 1 simbolo speciale (!\"#$%&'()*+,-./:;<=>?@[\\]^_{|}~ )."
77
+ },
78
+ "userUpdate": {
79
+ "role": "Ruolo",
80
+ "update": "Aggiorna"
81
+ },
82
+ "trendChart": {
83
+ "export": "Esporta",
84
+ "noDataMeasure": "Nessuna misurazione dati",
85
+ "connectPointValues": "Collega i valori dei punti",
86
+ "showAnnotations": "Mostra annotazioni"
87
+ },
88
+ "map": {
89
+ "noPositionsForDevices": "Nessuna posizione per i dispositivi"
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,74 @@
1
+ // script.js
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const ExcelJS = require('exceljs');
5
+ console.log(__dirname);
6
+ const LOCALES_DIR = path.resolve(__dirname, '../../translations');
7
+ const OUTPUT_FILE = path.resolve(__dirname, 'translations.xlsx');
8
+
9
+ // 1) Legge tutti i file *.json nella cartella locales
10
+ const files = fs.readdirSync(LOCALES_DIR).filter(f => f.endsWith('.json'));
11
+
12
+ // 2) Funzione ricorsiva per appiattire l'oggetto
13
+ function flatten(obj, prefix = '', res = {}) {
14
+ for (const [key, val] of Object.entries(obj)) {
15
+ const fullKey = prefix ? `${prefix}.${key}` : key;
16
+ if (val && typeof val === 'object' && !Array.isArray(val)) {
17
+ flatten(val, fullKey, res);
18
+ } else {
19
+ res[fullKey] = val;
20
+ }
21
+ }
22
+ return res;
23
+ }
24
+
25
+ async function buildWorkbook() {
26
+ // Carica ciascun file e appiattisci
27
+ const translations = {}; // { en: { key: val, ... }, it: { ... }, ... }
28
+ const allKeys = new Set();
29
+ for (const file of files) {
30
+ const lang = path.basename(file, '.json');
31
+ const content = JSON.parse(
32
+ fs.readFileSync(path.join(LOCALES_DIR, file), 'utf8'),
33
+ );
34
+ const flat = flatten(content);
35
+ translations[lang] = flat;
36
+ Object.keys(flat).forEach(k => allKeys.add(k));
37
+ }
38
+
39
+ // Prepara il workbook
40
+ const workbook = new ExcelJS.Workbook();
41
+ const sheet = workbook.addWorksheet('Translations');
42
+
43
+ // Intestazioni: Key + lingue in ordine alfabetico
44
+ const langs = Object.keys(translations).sort();
45
+ sheet.columns = [
46
+ {header: 'key', key: 'key', width: 50},
47
+ ...langs.map(l => ({header: l, key: l, width: 40})),
48
+ ];
49
+
50
+ // 3) Aggiungi le righe e verifica mancanze
51
+ allKeys.forEach(key => {
52
+ const row = {key};
53
+ langs.forEach(l => {
54
+ row[l] = translations[l][key] || '';
55
+ if (!translations[l][key]) {
56
+ // Log di warning per chiave mancante
57
+ console.warn(`⚠️ [${l}] mancante: ${key}`);
58
+ }
59
+ });
60
+ sheet.addRow(row);
61
+ });
62
+
63
+ // Formatta header in grassetto
64
+ sheet.getRow(1).font = {bold: true};
65
+
66
+ // 4) Salva
67
+ await workbook.xlsx.writeFile(OUTPUT_FILE);
68
+ console.log(`✅ File generato: ${OUTPUT_FILE}`);
69
+ }
70
+
71
+ buildWorkbook().catch(err => {
72
+ console.error(err);
73
+ process.exit(1);
74
+ });
@@ -0,0 +1,66 @@
1
+ // import-from-xlsx.js
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const ExcelJS = require('exceljs');
5
+
6
+ const INPUT_XLSX = path.resolve(__dirname, './translations.xlsx');
7
+ const OUTPUT_DIR = path.resolve(__dirname, './generated'); // dove salvare i file JSON
8
+
9
+ // Crea output dir se non esiste
10
+ if (!fs.existsSync(OUTPUT_DIR)) {
11
+ fs.mkdirSync(OUTPUT_DIR);
12
+ }
13
+
14
+ // Espande le chiavi a punti in oggetti annidati
15
+ function expandKey(obj, key, value) {
16
+ const parts = key.split('.');
17
+ let current = obj;
18
+ parts.forEach((part, i) => {
19
+ if (i === parts.length - 1) {
20
+ current[part] = value;
21
+ } else {
22
+ current[part] = current[part] || {};
23
+ current = current[part];
24
+ }
25
+ });
26
+ }
27
+
28
+ async function processExcel() {
29
+ const workbook = new ExcelJS.Workbook();
30
+ await workbook.xlsx.readFile(INPUT_XLSX);
31
+
32
+ const sheet = workbook.getWorksheet(1); // primo foglio
33
+ const headerRow = sheet.getRow(1).values;
34
+
35
+ const langs = headerRow.slice(2); // Salta "key" che è in colonna 1
36
+
37
+ const data = {}; // { en: { ... }, it: { ... } }
38
+
39
+ langs.forEach(lang => {
40
+ if (lang) data[lang] = {};
41
+ });
42
+
43
+ sheet.eachRow((row, rowNumber) => {
44
+ if (rowNumber === 1) return; // salta header
45
+
46
+ const key = row.getCell(1).value;
47
+ langs.forEach((lang, index) => {
48
+ const value = row.getCell(index + 2).value;
49
+ if (key && value != null) {
50
+ expandKey(data[lang], key, value);
51
+ }
52
+ });
53
+ });
54
+
55
+ // Scrivi i file JSON
56
+ for (const [lang, content] of Object.entries(data)) {
57
+ const outPath = path.join(OUTPUT_DIR, `${lang}.json`);
58
+ fs.writeFileSync(outPath, JSON.stringify(content, null, 2), 'utf8');
59
+ console.log(`✅ Creato: ${outPath}`);
60
+ }
61
+ }
62
+
63
+ processExcel().catch(err => {
64
+ console.error(err);
65
+ process.exit(1);
66
+ });
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@iotready/nextjs-components-library",
3
- "version": "1.0.0-preview39",
3
+ "version": "1.0.0-preview40",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
- "build": "rm -rf dist && tsc --project tsconfig.build.json && cp package.json dist/",
6
+ "build": "rm -rf dist && tsc --project tsconfig.build.json && cp package.json dist/ && cp -r assets dist/",
7
7
  "dev": "next dev",
8
8
  "start": "next start",
9
9
  "lint": "next lint"