From 6676b32f9ae1be39b3ba9ecfea80c2edcc0b2aba Mon Sep 17 00:00:00 2001 From: Alessandro Cocco Date: Mon, 7 Feb 2022 22:28:02 +0100 Subject: [PATCH 1/2] Improve language_scan tool --- bin/language_scan.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/bin/language_scan.js b/bin/language_scan.js index ba0914ad93..b2e98b5f35 100755 --- a/bin/language_scan.js +++ b/bin/language_scan.js @@ -157,19 +157,29 @@ log(untranslatedStrings.filter(e => e.uses>2).filter(e => !translatedStrings.fin log(""); //process.exit(1); -var languages = JSON.parse(fs.readFileSync(BASEDIR+"/lang/index.json").toString()); +let languages = JSON.parse(fs.readFileSync(`${BASEDIR}/lang/index.json`).toString()); languages.forEach(language => { - if (language.code=="en_GB") { - console.log("Ignoring "+language.code); + if (language.code == "en_GB") { + console.log(`Ignoring ${language.code}`); return; } - console.log("Scanning "+language.code); + console.log(`Scanning ${language.code}`); log(language.code); log("=========="); - var translations = JSON.parse(fs.readFileSync(BASEDIR+"/lang/"+language.url).toString()); - translatedStrings.forEach(str => { - if (!translations.GLOBAL[str.str]) - console.log(`Missing translation for ${JSON.stringify(str)}`); + let translations = JSON.parse(fs.readFileSync(`${BASEDIR}/lang/${language.url}`).toString()); + translatedStrings.forEach(translationItem => { + if (!translations.GLOBAL[translationItem.str]) { + console.log(`Missing GLOBAL translation for ${JSON.stringify(translationItem)}`); + translationItem.files.forEach(file => { + let m = file.match(/\/([a-zA-Z0-9_-]*)\//g); + if (m && m[0]) { + let appName = m[0].replaceAll("/", ""); + if (translations[appName] && translations[appName][translationItem.str]) { + console.log(` but LOCAL translation found in \"${appName}\"`); + } + } + }); + } }); log(""); }); From 6cf60c247660e5f40431bdba1cafea39febbf514 Mon Sep 17 00:00:00 2001 From: Alessandro Cocco Date: Mon, 7 Feb 2022 22:29:17 +0100 Subject: [PATCH 2/2] Add Italian translations --- apps/alarm/boot.js | 2 +- apps/launch/settings.js | 2 +- lang/it_IT.json | 159 ++++++++++++++++++++++++++++++++++++---- 3 files changed, 145 insertions(+), 18 deletions(-) diff --git a/apps/alarm/boot.js b/apps/alarm/boot.js index dffb3a37fe..47dae53618 100644 --- a/apps/alarm/boot.js +++ b/apps/alarm/boot.js @@ -7,7 +7,7 @@ active = active.sort((a,b)=>(a.hr-b.hr)+(a.last-b.last)*24); var hr = time.getHours()+(time.getMinutes()/60)+(time.getSeconds()/3600); if (!require('Storage').read("alarm.js")) { - console.log(/*LANG*/"No alarm app!"); + console.log("No alarm app!"); require('Storage').write('alarm.json',"[]"); } else { var t = 3600000*(active[0].hr-hr); diff --git a/apps/launch/settings.js b/apps/launch/settings.js index 1bb3d5c9ae..60422e75c3 100644 --- a/apps/launch/settings.js +++ b/apps/launch/settings.js @@ -8,7 +8,7 @@ require("Storage").write("launch.json",settings); } const appMenu = { - /*LANG*/"": {"title": /*LANG*/"Launcher Settings"}, + "": {"title": /*LANG*/"Launcher Settings"}, /*LANG*/"< Back": back, /*LANG*/"Font": { value: fonts.includes(settings.font)? fonts.indexOf(settings.font) : fonts.indexOf("12x20"), diff --git a/lang/it_IT.json b/lang/it_IT.json index 96293cbf39..c64fc828a0 100644 --- a/lang/it_IT.json +++ b/lang/it_IT.json @@ -1,21 +1,148 @@ { - "//":"Italian language translations", + "//1": "Italian language translations", "GLOBAL": { - "//":"Translations that apply for all apps", - "Alarms" : "Sveglie", - "Hours" : "Ore", - "Minutes" : "Minuti", - "Enabled" : "Attiva", - "New Alarm" : "Nuova sveglia", - "Save" : "Salva", - "Back" : "Indietro", - "Repeat" : "Ripeti", - "Delete" : "Cancella", - "ALARM!" : "SVEGLIA!", - "Sleep" : "Dormi" + "//": "Translations that apply for all apps", + "On": "On", + "on": "on", + "Off": "Off", + "off": "off", + "Ok": "Ok", + "Yes": "Sì", + "No": "No", + "Alarm": "Sveglia", + "ALARM": "SVEGLIA", + "Alarms": "Sveglie", + "Date": "Data", + "Year": "Anno", + "Month": "Mese", + "Day": "Giorno", + "Hour": "Ora", + "Hours": "Ore", + "Minute": "Minuto", + "Minutes": "Minuti", + "Second": "Secondo", + "Seconds": "Secondi", + "week": "settimana", + "Week": "Settimana", + "Enabled": "Attivo/a", + "New Alarm": "Nuova sveglia", + "Save": "Salva", + "Cancel": "Annulla", + "Back": "Indietro", + "Repeat": "Ripeti", + "Delete": "Cancella", + "ALARM!": "SVEGLIA!", + "Sleep": "Dormi", + "Timer": "Timer", + "TIMER": "TIMER", + "New Timer": "Nuovo timer", + "(repeat)": "(ripeti)", + "Auto snooze": "Posticipa automaticamente", + "Connected": "Connesso", + "Delete all messages": "Cancella tutti i messaggi", + "Delete All Messages": "Cancella tutti i messaggi", + "Message": "Messaggio", + "Messages": "Messaggi", + "No Messages": "Nessun messaggio", + "Keep Msgs": "Tieni i messaggi", + "Mark Unread": "Segna come non letto", + "Vibrate": "Vibrazione", + "Are you sure": "Sei sicuro/a", + "Music": "Musica", + "Apps": "App", + "App Settings": "Impostazioni app", + "Bluetooth": "Bluetooth", + "BLE": "BLE", + "Make Connectable": "Rendi collegabile", + "Programmable": "Programmabile", + "Remove": "Rimuovi", + "Utils": "Utilità", + "LCD": "LCD", + "LCD Brightness": "Luminosità LCD", + "LCD Timeout": "Timeout LCD", + "Wake on BTN1": "Risveglia con BTN1", + "Wake on BTN2": "Risveglia con BTN2", + "Wake on BTN3": "Risveglia con BTN3", + "Wake on FaceUp": "Risveglia a faccia in su", + "Wake on Touch": "Risveglia al tocco", + "Wake on Twist": "Risveglia con polso", + "Twist Timeout": "Timeout torsione", + "Twist Max Y": "Torsione Y max", + "Twist Threshold": "Soglia torsione", + "Customize": "Personalizza", + "Add Device": "Aggiungi dispositivo", + "Left": "Sinistra", + "Right": "Destra", + "Widgets": "Widget", + "Settings": "Impostazioni", + "No app has settings": "Non ci sono app con delle impostazioni", + "System": "Sistema", + "Alerts": "Avvisi", + "Theme": "Tema", + "Foreground": "Primo piano", + "Background": "Sfondo", + "Foreground 2": "Primo piano 2", + "Background 2": "Sfondo 2", + "Highlight FG": "Selezione PP", + "Highlight BG": "Selezione Sf", + "Utilities": "Utilità", + "Storage": "Memoria", + "Compact Storage": "Compatta memoria", + "Select Clock": "Seleziona orologio", + "No Clocks Found": "Nessun orologio trovato", + "Locale": "Localizzazione", + "Set Time": "Imposta orario", + "Time Zone": "Fuso orario", + "Whitelist": "Whitelist", + "Quiet Mode": "Modalità silenziosa", + "Disable": "Disabilita", + "Vibration": "Vibrazione", + "Show": "Mostra", + "Hide": "Nascondi", + "Rewrite Settings": "Riscrivi impostazioni", + "Reset Settings": "Reset impostazioni", + "Factory Reset": "Ripristino condizioni iniziali", + "Flatten Battery": "Scarica la batteria", + "Turn Off": "Spegni", + "This will remove everything": "Questo rimuoverà TUTTO", + "Error in settings": "Errore nelle impostazioni", + "Invalid settings": "Impostazioni non valide", + "Loading": "Caricamento", + "Launcher Settings": "Impostazioni Launcher", + "Font": "Font", + "Show clocks": "Mostra orologi", + "Log": "Log", + "Steps": "Passi", + "steps": "passi" }, - "alarm": { - "//":"App-specific overrides", - "rpt" : "ripeti" + "//2": "App-specific overrides", + "launch": { + "Vector font size": "Dim. font vett.", + "App Source\nNot found": "Codice app\nnon trovato" + }, + "messages": { + "Unread timer": "Timer msg non letti" + }, + "run": { + "Record Run": "Registra corsa" + }, + "setting": { + "Clock Style": "Formato ora", + "Compacting...\nTakes approx\n1 minute": "Compattamento in corso...\nCi vorrà circa un minuto", + "//1": "The new line before 'operazione' improves the layout", + "Flattening battery - this can take hours.\nLong-press button to cancel": "Scaricamento batteria in corso - l'\noperazione può richiedere ore. Tieni premuto il pulsante per annullare", + "Reset to Defaults": "Ripristinare le impostazioni predefinite", + "Connectable": "Collegamento", + "Connect device\nto add to\nwhitelist": "Collega un\ndispositivo\nper metterlo\nin whitelist", + "Stay Connectable": "Rimanere collegabile", + "Light BW": "Chiaro", + "Dark BW": "Scuro" + }, + "wid_edit": { + "Reset": "Ripristina", + "Reset All": "Ripristina tutto", + "Reset all widgets": "Ripristina tutti i widget", + "Sort Order": "Ordinamento", + "Side": "Lato" } }