Merge pull request #70 from AmadeusGraves/patch-1

Added Spanish Translation
This commit is contained in:
Giuliano Bellini
2023-02-11 04:58:04 -05:00
committed by GitHub
4 changed files with 89 additions and 5 deletions

View File

@@ -9,6 +9,8 @@ pub enum Language {
IT,
/// French.
FR,
/// Spanish.
ES,
}
impl Default for Language {
@@ -18,13 +20,14 @@ fn default() -> Self {
}
impl Language {
pub(crate) const ALL: [Language; 3] = [Language::EN, Language::IT, Language::FR];
pub(crate) const ALL: [Language; 4] = [Language::EN, Language::IT, Language::FR, Language::ES];
pub fn get_radio_label(&self) -> &str {
match self {
Language::EN => "English",
Language::IT => "Italiano",
Language::FR => "Français",
Language::ES => "Español",
}
}
}

View File

@@ -235,7 +235,7 @@ fn packets_notification_log(
Container::new(content)
.height(Length::Units(120))
.width(Length::Units(800))
.padding(20)
.padding(15)
.style(<StyleTuple as Into<iced::theme::Container>>::into(
StyleTuple(style, ElementType::BorderedRound),
))
@@ -318,7 +318,7 @@ fn bytes_notification_log(
Container::new(content)
.height(Length::Units(120))
.width(Length::Units(800))
.padding(20)
.padding(15)
.style(<StyleTuple as Into<iced::theme::Container>>::into(
StyleTuple(style, ElementType::BorderedRound),
))
@@ -391,7 +391,7 @@ fn favorite_notification_log(
Container::new(content)
.height(Length::Units(120))
.width(Length::Units(800))
.padding(20)
.padding(15)
.style(<StyleTuple as Into<iced::theme::Container>>::into(
StyleTuple(style, ElementType::BorderedRound),
))

View File

@@ -584,7 +584,7 @@ fn get_palette_container(
Button::new(content)
.height(Units(130))
.width(Units(350))
.width(Units(360))
.padding(10)
.style(StyleTuple(style, ElementType::BorderedRound).into())
.on_press(Message::Style(on_press))

View File

@@ -6,6 +6,7 @@ pub fn choose_adapters_translation(language: Language) -> Text<'static> {
Language::EN => "Select network adapter to inspect",
Language::IT => "Seleziona la scheda di rete da ispezionare",
Language::FR => "Sélectionnez une carte réseau à inspecter",
Language::ES => "Seleccione el adaptador de red que desea inspeccionar",
})
}
@@ -14,6 +15,7 @@ pub fn application_protocol_translation(language: Language) -> &'static str {
Language::EN => "Application protocol",
Language::IT => "Protocollo applicativo",
Language::FR => "Protocole applicatif",
Language::ES => "Protocolo de aplicación",
}
}
@@ -22,6 +24,7 @@ pub fn select_filters_translation(language: Language) -> Text<'static> {
Language::EN => "Select filters to be applied on network traffic",
Language::IT => "Seleziona i filtri da applicare al traffico di rete",
Language::FR => "Sélectionnez les filtres à appliquer sur le traffic réseau",
Language::ES => "Seleccionar los filtros que se aplicarán al tráfico de red",
})
}
@@ -30,6 +33,7 @@ pub fn start_translation(language: Language) -> &'static str {
Language::EN => "Start!",
Language::IT => "Avvia!",
Language::FR => "Commencer!",
Language::ES => "¡Empieza!",
}
}
@@ -38,6 +42,7 @@ pub fn address_translation(language: Language) -> &'static str {
Language::EN => "\nAddress:",
Language::IT => "\nIndirizzo:",
Language::FR => "\nAdresse:",
Language::ES => "\nDirección:",
}
}
@@ -46,6 +51,7 @@ pub fn addresses_translation(language: Language) -> &'static str {
Language::EN => "\nAddresses:",
Language::IT => "\nIndirizzi:",
Language::FR => "\nAdresses:",
Language::ES => "\nDirecciones:",
}
}
@@ -54,6 +60,7 @@ pub fn ip_version_translation(language: Language) -> Text<'static> {
Language::EN => "IP version",
Language::IT => "Versione IP",
Language::FR => "Version IP",
Language::ES => "Versión IP",
})
}
@@ -62,6 +69,7 @@ pub fn transport_protocol_translation(language: Language) -> &'static str {
Language::EN => "Transport protocol",
Language::IT => "Protocollo di trasporto",
Language::FR => "Protocole de transport",
Language::ES => "Protocolo de transporte",
}
}
@@ -70,6 +78,7 @@ pub fn traffic_rate_translation(language: Language) -> Text<'static> {
Language::EN => "Traffic rate:",
Language::IT => "Intensità del traffico:",
Language::FR => "Fréquence du traffic:",
Language::ES => "Tasa de tráfico:",
})
}
@@ -78,6 +87,7 @@ pub fn relevant_connections_translation(language: Language) -> Text<'static> {
Language::EN => "Relevant connections:",
Language::IT => "Connessioni rilevanti:",
Language::FR => "Connexions pertinentes:",
Language::ES => "Conexiones Relevantes:",
})
}
@@ -86,6 +96,7 @@ pub fn settings_translation(language: Language) -> &'static str {
Language::EN => "Settings",
Language::IT => "Impostazioni",
Language::FR => "Paramètres",
Language::ES => "Ajustes",
}
}
@@ -94,6 +105,7 @@ pub fn yes_translation(language: Language) -> Text<'static> {
Language::EN => "Yes",
Language::IT => "",
Language::FR => "Oui",
Language::ES => "",
})
}
@@ -102,6 +114,7 @@ pub fn ask_quit_translation(language: Language) -> Text<'static> {
Language::EN => "Are you sure you want to quit this analysis?",
Language::IT => "Sei sicuro di voler interrompere questa analisi?",
Language::FR => "Êtes-vous sûr de vouloir quitter l'application ?",
Language::ES => "¿Estás seguro de que quieres dejar este análisis?",
})
}
@@ -110,6 +123,7 @@ pub fn quit_analysis_translation(language: Language) -> String {
Language::EN => "Quit analysis".to_string(),
Language::IT => "Interrompi analisi".to_string(),
Language::FR => "Quitter l'analyse".to_string(),
Language::ES => "Quitar el análisis".to_string(),
}
}
@@ -118,6 +132,7 @@ pub fn ask_clear_all_translation(language: Language) -> Text<'static> {
Language::EN => "Are you sure you want to clear notifications?",
Language::IT => "Sei sicuro di voler eliminare le notifiche?",
Language::FR => "Êtes-vous sûr de vouloir effacer les notifications ?",
Language::ES => "¿Seguro que quieres borrar las notificaciones?",
})
}
@@ -126,6 +141,7 @@ pub fn clear_all_translation(language: Language) -> String {
Language::EN => "Clear all".to_string(),
Language::IT => "Elimina tutte".to_string(),
Language::FR => "Tout effacer".to_string(),
Language::ES => "Borrar todo".to_string(),
}
}
@@ -134,6 +150,7 @@ pub fn hide_translation(language: Language) -> &'static str {
Language::EN => "Hide",
Language::IT => "Nascondi",
Language::FR => "Masquer",
Language::ES => "Ocultar",
}
}
@@ -148,6 +165,9 @@ pub fn no_addresses_translation(language: Language, adapter: &str) -> Text<'stat
Language::FR => format!("Aucun trafic ne peut être observé, car la carte réseau que vous avez saisie n'a pas d'adresse...\n\n\
Carte réseau : {adapter}\n\n\
Si vous êtes sûr d'être connecté à internet, essayez une autre carte."),
Language::ES => format!("No se puede observar ningún tráfico porque el adaptador seleccionado no tiene direcciones activas...\n\n\
Adaptador de red : {adapter}\n\n\
Si estás seguro de que estás conectado a Internet, prueba a elegir otro adaptador."),
})
}
@@ -162,6 +182,9 @@ pub fn waiting_translation(language: Language, adapter: &str) -> Text<'static> {
Language::FR => format!("Aucun trafic n'a été capturé pour le moment. En attente de paquets...\n\n\
Carte réseau : {adapter}\n\n\
Êtes-vous sûr d'être connecté à internet et d'avoir selectionné la bonne carte réseau ?"),
Language::ES => format!("Aún no se ha captado tráfico. Esperando paquetes...\n\n\
Adaptador de red : {adapter}\n\n\
¿Está seguro de que está conectado a Internet y ha seleccionado la tarjeta de red correcta?"),
})
}
@@ -180,6 +203,9 @@ pub fn some_observed_translation(
Language::FR => format!("Total des paquets interceptés: {observed}\n\n\
Paquets filtrés: 0\n\n\
Certains paquets ont été interceptés, mais aucun ne satisfait les critères des filtres sélectionnés...\n\n{filters}"),
Language::ES => format!("Total de paquetes interceptados: {observed}\n\n\
Paquetes filtrados: 0\n\n\
Se interceptaron algunos paquetes, pero ninguno de ellos cumplía los criterios de los filtros seleccionados...\n\n{filters}"),
})
}
@@ -192,6 +218,7 @@ pub fn filtered_packets_translation(
Language::EN => format!("Filtered packets:\n {filtered} ({percentage} of the total)"),
Language::IT => format!("Pacchetti filtrati:\n {filtered} ({percentage} del totale)"),
Language::FR => format!("Paquets filtrés:\n {filtered} ({percentage} du total)"),
Language::ES => format!("Paquetes filtrados:\n {filtered} ({percentage} del total)"),
})
}
@@ -204,6 +231,7 @@ pub fn filtered_bytes_translation(
Language::EN => format!("Filtered bytes:\n {filtered} ({percentage} of the total)"),
Language::IT => format!("Byte filtrati:\n {filtered} ({percentage} del totale)"),
Language::FR => format!("Octets filtrés:\n {filtered} ({percentage} du total)"),
Language::ES => format!("Bytes filtrados:\n {filtered} ({percentage} del total)"),
})
}
@@ -212,6 +240,7 @@ pub fn filtered_application_translation(language: Language) -> Text<'static> {
Language::EN => "Filtered packets per application protocol:",
Language::IT => "Pacchetti filtrati per protocollo applicativo:",
Language::FR => "Paquets filtrés par protocole applicatif:",
Language::ES => "Paquetes filtrados por protocolo de aplicación:",
})
}
@@ -223,6 +252,8 @@ pub fn no_favorites_translation(language: Language) -> Text<'static> {
Per aggiungere una connessione ai tuoi preferiti, clicca sul simbolo della stella vicino alla connessione.",
Language::FR => "Rien a voir pour le moment.\n\
Pour ajouter une connexion à vos favoris, cliquez sur l'étoile à côté de la connexion.",
Language::ES => "Nada que mostrar por el momento.\n\
Para añadir una conexión a sus favoritos, haga clic en el símbolo de la estrella situado junto a la conexión.",
})
}
@@ -240,6 +271,10 @@ pub fn error_translation(language: Language, error: &str) -> Text<'static> {
"Une erreur est survenue! \n\n\
{error}"
),
Language::ES => format!(
"¡Se ha producido un error! \n\n\
{error}"
),
})
}
@@ -248,6 +283,7 @@ pub fn both_translation(language: Language) -> &'static str {
Language::EN => "both",
Language::IT => "entrambi",
Language::FR => "les deux",
Language::ES => "ambos",
}
}
@@ -256,6 +292,7 @@ pub fn both_translation(language: Language) -> &'static str {
// Language::EN => "All protocols",
// Language::IT => "Tutti i protocolli",
// Language::FR => "Tous les protocoles",
// Language::ES => "Todos los protocolos",
// }
// }
@@ -264,6 +301,7 @@ pub fn packets_chart_translation(language: Language) -> &'static str {
Language::EN => "packets per second",
Language::IT => "pacchetti al secondo",
Language::FR => "paquets par seconde",
Language::ES => "paquetes por segundo",
}
}
@@ -272,6 +310,7 @@ pub fn bytes_chart_translation(language: Language) -> &'static str {
Language::EN => "bytes per second",
Language::IT => "byte al secondo",
Language::FR => "octets par seconde",
Language::ES => "bytes por segundo",
}
}
@@ -280,6 +319,7 @@ pub fn recent_report_translation(language: Language) -> &'static str {
Language::EN => "most recent",
Language::IT => "più recenti",
Language::FR => "la plus récente",
Language::ES => "más reciente",
}
}
@@ -288,6 +328,7 @@ pub fn packets_report_translation(language: Language) -> &'static str {
Language::EN => "most packets",
Language::IT => "più pacchetti",
Language::FR => "le plus de paquets",
Language::ES => "mayoría de los paquetes",
}
}
@@ -296,6 +337,7 @@ pub fn bytes_report_translation(language: Language) -> &'static str {
Language::EN => "most bytes",
Language::IT => "più byte",
Language::FR => "le plus de données",
Language::ES => "mayoría de los bytes",
}
}
@@ -304,6 +346,7 @@ pub fn favorite_report_translation(language: Language) -> &'static str {
Language::EN => "favorites",
Language::IT => "preferiti",
Language::FR => "favoris",
Language::ES => "favoritos",
}
}
@@ -312,6 +355,7 @@ pub fn notifications_title_translation(language: Language) -> Text<'static> {
Language::EN => "Customize your notifications",
Language::IT => "Personalizza le tue notifiche",
Language::FR => "Personnalisez vos notifications",
Language::ES => "Personaliza tus notificaciones",
})
}
@@ -320,6 +364,7 @@ pub fn appearance_title_translation(language: Language) -> Text<'static> {
Language::EN => "Choose your favorite theme",
Language::IT => "Scegli il tuo tema preferito",
Language::FR => "Sélectionnez votre thème préféré",
Language::ES => "Elige tu tema favorito",
})
}
@@ -328,6 +373,7 @@ pub fn languages_title_translation(language: Language) -> Text<'static> {
Language::EN => "Select your language",
Language::IT => "Seleziona la lingua",
Language::FR => "Sélectionnez votre langue",
Language::ES => "Selecciona tu idioma",
})
}
@@ -336,6 +382,7 @@ pub fn active_filters_translation(language: Language) -> &'static str {
Language::EN => "Active filters:",
Language::IT => "Filtri attivi:",
Language::FR => "Filtres actifs",
Language::ES => "Filtros activos:",
}
}
@@ -344,6 +391,7 @@ pub fn none_translation(language: Language) -> &'static str {
Language::EN => "none",
Language::IT => "nessuno",
Language::FR => "aucun",
Language::ES => "ninguno",
}
}
@@ -352,6 +400,7 @@ pub fn yeti_night_translation(language: Language) -> &'static str {
Language::EN => "Sniffnet's original dark theme",
Language::IT => "Il tema scuro originale di Sniffnet",
Language::FR => "Thème original sombre de Sniffnet",
Language::ES => "Tema oscuro original de Sniffnet",
}
}
@@ -360,6 +409,7 @@ pub fn yeti_day_translation(language: Language) -> &'static str {
Language::EN => "Sniffnet's original light theme",
Language::IT => "Il tema chiaro originale di Sniffnet",
Language::FR => "Thème original clair de Sniffnet",
Language::ES => "Tema claro original de Sniffnet",
}
}
@@ -368,6 +418,7 @@ pub fn deep_sea_translation(language: Language) -> &'static str {
Language::EN => "To dive into network traffic",
Language::IT => "Per immergersi nel traffico di rete",
Language::FR => "Pour plonger dans votre trafic réseau",
Language::ES => "Para sumergirse en el tráfico de la red",
}
}
@@ -376,6 +427,7 @@ pub fn mon_amour_translation(language: Language) -> &'static str {
Language::EN => "Lovely theme made for dreamers",
Language::IT => "Tema incantevole fatto per i sognatori",
Language::FR => "Thème romantique fait pour les rêveurs",
Language::ES => "Tema encantador hecho para soñadores",
}
}
@@ -384,6 +436,7 @@ pub fn incoming_translation(language: Language) -> &'static str {
Language::EN => "Incoming",
Language::IT => "In entrata",
Language::FR => "Entrant",
Language::ES => "Entrante",
}
}
@@ -392,6 +445,7 @@ pub fn outgoing_translation(language: Language) -> &'static str {
Language::EN => "Outgoing",
Language::IT => "In uscita",
Language::FR => "Sortant",
Language::ES => "Saliente",
}
}
@@ -400,6 +454,7 @@ pub fn notifications_translation(language: Language) -> &'static str {
Language::EN => "Notifications",
Language::IT => "Notifiche",
Language::FR => "Notifications",
Language::ES => "Notificaciones",
}
}
@@ -408,6 +463,7 @@ pub fn style_translation(language: Language) -> &'static str {
Language::EN => "Style",
Language::IT => "Stile",
Language::FR => "Style",
Language::ES => "Estilo",
}
}
@@ -416,6 +472,7 @@ pub fn language_translation(language: Language) -> &'static str {
Language::EN => "Language",
Language::IT => "Lingua",
Language::FR => "Langue",
Language::ES => "Idioma",
}
}
@@ -424,6 +481,7 @@ pub fn overview_translation(language: Language) -> &'static str {
Language::EN => "Overview",
Language::IT => "Panoramica",
Language::FR => "Résumé",
Language::ES => "Resumen",
}
}
@@ -432,6 +490,7 @@ pub fn overview_translation(language: Language) -> &'static str {
// Language::EN => "Inspect",
// Language::IT => "Ispeziona",
// Language::FR => "Inspecter",
// Language::ES => "Inspeccionar",
// }
// }
@@ -440,6 +499,7 @@ pub fn packets_threshold_translation(language: Language) -> &'static str {
Language::EN => "Notify me when a packets threshold is exceeded",
Language::IT => "Notificami quando una soglia di pacchetti è superata",
Language::FR => "Me notifier lorsqu'un seuil de paquet est atteint",
Language::ES => "Notificarme cuando se supere un límite de paquetes",
}
}
@@ -448,6 +508,7 @@ pub fn bytes_threshold_translation(language: Language) -> &'static str {
Language::EN => "Notify me when a bytes threshold is exceeded",
Language::IT => "Notificami quando una soglia di byte è superata",
Language::FR => "Me notifier lorsqu'un seuil de donnée est atteint",
Language::ES => "Notificarme cuando se exceda un límite de bytes",
}
}
@@ -456,6 +517,7 @@ pub fn per_second_translation(language: Language) -> &'static str {
Language::EN => "(per second)",
Language::IT => "(al secondo)",
Language::FR => "(par seconde)",
Language::ES => "(por segundo)",
}
}
@@ -464,6 +526,7 @@ pub fn specify_multiples_translation(language: Language) -> &'static str {
Language::EN => "; you can also specify 'K', 'M' and 'G'",
Language::IT => "; puoi anche specificare 'K', 'M' e 'G'",
Language::FR => "; vous pouvez également spécifier 'K', 'M' et 'G'",
Language::ES => "; también puede especificar 'K', 'M' y 'G'",
}
}
@@ -472,6 +535,7 @@ pub fn favorite_notification_translation(language: Language) -> &'static str {
Language::EN => "Notify me when new data are exchanged from my favorites",
Language::IT => "Notificami quando nuovi dati sono scambiati dai miei preferiti",
Language::FR => "Notifiez-moi lorsque des données sont échangées depuis mes favoris",
Language::ES => "Notificarme cuando se intercambien nuevos datos de mis favoritos",
}
}
@@ -480,6 +544,7 @@ pub fn threshold_translation(language: Language) -> String {
Language::EN => "Threshold: ".to_string(),
Language::IT => "Soglia: ".to_string(),
Language::FR => "Seuil: ".to_string(),
Language::ES => "Límite: ".to_string(),
}
}
@@ -488,6 +553,7 @@ pub fn volume_translation(language: Language, value: u8) -> String {
Language::EN => format!("Volume: {value:^3}%"),
Language::IT => format!("Volume: {value:^3}%"),
Language::FR => format!("Volume: {value:^3}%"),
Language::ES => format!("Volumen: {value:^3}%"),
}
}
@@ -496,6 +562,7 @@ pub fn sound_translation(language: Language) -> &'static str {
Language::EN => "Sound:",
Language::IT => "Suono:",
Language::FR => "Son:",
Language::ES => "Sonido:",
}
}
@@ -504,6 +571,7 @@ pub fn open_report_translation(language: Language) -> &'static str {
Language::EN => "Open full report",
Language::IT => "Apri report completo",
Language::FR => "Ouvrir le rapport complet",
Language::ES => "Abrir el informe completo",
}
}
@@ -512,6 +580,7 @@ pub fn bytes_exceeded_translation(language: Language) -> &'static str {
Language::EN => "Bytes threshold exceeded!",
Language::IT => "Soglia di Byte superata!",
Language::FR => "Seuil de donnée atteint!",
Language::ES => "¡Límite de bytes superado!",
}
}
@@ -521,6 +590,7 @@ pub fn bytes_exceeded_value_translation(language: Language, value: &str) -> Stri
Language::EN => format!("{trimmed_value} bytes have been exchanged"),
Language::IT => format!("{trimmed_value} byte sono stati scambiati"),
Language::FR => format!("{trimmed_value} octets ont été échangé"),
Language::ES => format!("{trimmed_value} byte/s han sido intercambiado/s"),
}
}
@@ -529,6 +599,7 @@ pub fn packets_exceeded_translation(language: Language) -> &'static str {
Language::EN => "Packets threshold exceeded!",
Language::IT => "Soglia di pacchetti superata!",
Language::FR => "Le seuil de paquet a été atteint!",
Language::ES => "¡Se ha superado el límite de paquetes!",
}
}
@@ -540,6 +611,7 @@ pub fn packets_exceeded_value_translation(language: Language, value: u32) -> Str
1 => "1 paquet a été échangé".to_owned(),
npackets => format!("{npackets} paquets ont été échangés"),
},
Language::ES => format!("{value} paquete/s han sido intercambiado/s"),
}
}
@@ -548,6 +620,7 @@ pub fn favorite_transmitted_translation(language: Language) -> &'static str {
Language::EN => "New data exchanged from favorites!",
Language::IT => "Nuovi dati scambiati dai preferiti!",
Language::FR => "Nouvel échange de donnée depuis un favori!",
Language::ES => "¡Nuevos datos intercambiados de favoritos!",
}
}
@@ -562,6 +635,9 @@ pub fn no_notifications_set_translation(language: Language) -> Text<'static> {
Language::FR => "Vous n'avez pas activé les notifications!\n\n\
Une fois activées, cette page affichera le journal des notifications\n\n\
Vous pouvez les activer dans les paramètres:",
Language::ES => "¡Aún no has activado las notificaciones!\n\n\
Después de activarlas, esta página mostrará un registro de sus notificaciones\n\n\
Puedes activar las notificaciones desde los ajustes:",
})
}
@@ -579,6 +655,10 @@ pub fn no_notifications_received_translation(language: Language) -> Text<'static
"Rien à voir pour le moment...\n\n\
Lorsque vous recevrez une notification, elle s'affichera ici"
}
Language::ES => {
"Nada que ver por el momento...\n\n\
Cuando reciba una notificación, aparecerá aquí"
}
})
}
@@ -587,5 +667,6 @@ pub fn only_last_30_translation(language: Language) -> &'static str {
Language::EN => "Only the last 30 notifications are displayed",
Language::IT => "Solo le ultime 30 notifiche sono mostrate",
Language::FR => "Seulement les 30 dernières notifications sont affichées",
Language::ES => "Sólo se muestran las últimas 30 notificaciones",
}
}