Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from GyulyVGC:main #177

Merged
merged 7 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All Sniffnet releases with the relative changes are documented in this file.
- Updated some of the existing translations to v1.3:
- French - [#494](https://github.com/GyulyVGC/sniffnet/pull/494)
- German - [#495](https://github.com/GyulyVGC/sniffnet/pull/495)
- Polish - [#498](https://github.com/GyulyVGC/sniffnet/pull/498)

## [1.3.0] - 2024-04-08
- Introduced thumbnail mode, enabling users to keep an eye on Sniffnet while doing other tasks ([#484](https://github.com/GyulyVGC/sniffnet/pull/484))
Expand Down
16 changes: 16 additions & 0 deletions fonts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/zsh

# Script used to subset the font files to only include the necessary glyphs

FULL_FOLDER=resources/fonts/full
SUBSET_FOLDER=resources/fonts/subset
CHARACTERS_FILE=subset_characters.txt
FONT_NAME=sarasa-mono-sc

grep -o --no-filename . ./src/**/* | sort -u > $FULL_FOLDER/$CHARACTERS_FILE

pyftsubset $FULL_FOLDER/$FONT_NAME-bold.ttf --text-file=$FULL_FOLDER/$CHARACTERS_FILE --no-ignore-missing-unicodes
pyftsubset $FULL_FOLDER/$FONT_NAME-regular.ttf --text-file=$FULL_FOLDER/$CHARACTERS_FILE --no-ignore-missing-unicodes

mv $FULL_FOLDER/$FONT_NAME-bold.subset.ttf $SUBSET_FOLDER/$FONT_NAME-bold.subset.ttf
mv $FULL_FOLDER/$FONT_NAME-regular.subset.ttf $SUBSET_FOLDER/$FONT_NAME-regular.subset.ttf
2 changes: 1 addition & 1 deletion resources/fonts/full/subset_characters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ z
ı
ł
ń
Ś
ś
Ş
ş
Expand Down Expand Up @@ -290,7 +291,6 @@ z
۳
Expand Down
Binary file modified resources/fonts/subset/sarasa-mono-sc-bold.subset.ttf
Binary file not shown.
Binary file modified resources/fonts/subset/sarasa-mono-sc-regular.subset.ttf
Binary file not shown.
4 changes: 2 additions & 2 deletions src/translations/translations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ pub fn ask_quit_translation(language: Language) -> Text<'static, StyleType> {
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?",
Language::PL => "Czy na pewno chcesz zakończyć analizę?",
Language::PL => "Jesteś pewien, że chcesz zakończyć analizę?",
Language::DE => "Bist du sicher, dass du diese Analyse beenden willst?",
Language::UK => "Чи справді хочеш закінчити аналіз?",
Language::ZH => "您确定退出当前监控吗?",
Expand Down Expand Up @@ -1677,7 +1677,7 @@ pub fn packets_exceeded_translation(language: Language) -> &'static str {
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!",
Language::PL => "Próg pakietów przekroczony!",
Language::PL => "Przekroczono próg pakietów!",
Language::DE => "Paket-Schwellenwert überschritten!",
Language::UK => "Ліміт пакетів перевищено!",
Language::ZH => "达到设定的数据包数量阈值!",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/translations_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ pub fn destination_translation(language: Language) -> &'static str {
Language::ZH => "目标",
Language::UK => "Призначення",
Language::RO => "Destinație",
Language::PL => "Miejsce docelowe", // Depending on context these two are also valid: "Przeznaczenie" / "Cel"
Language::PL => "Miejsce docelowe",
Language::FR => "Destination",
Language::JA => "送信先",
Language::UZ => "Qabul qiluvchi",
Expand Down
23 changes: 22 additions & 1 deletion src/translations/translations_3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ pub fn general_translation(language: Language) -> &'static str {
Language::IT => "Generali",
Language::FR => "Général",
Language::DE => "Allgemein",
Language::PL => "Ogólne",
_ => "General",
}
}

pub fn zoom_translation(language: Language) -> &'static str {
match language {
Language::EN | Language::IT | Language::ES | Language::FR | Language::DE => "Zoom",
Language::PL => "Powiększenie",
_ => "Zoom",
}
}
Expand All @@ -31,6 +33,7 @@ pub fn mmdb_files_translation(language: Language) -> &'static str {
Language::IT => "File di database",
Language::FR => "Fichiers de la base de données",
Language::DE => "Datenbank Dateien",
Language::PL => "Pliki bazy danych",
_ => "Database files",
}
}
Expand All @@ -42,6 +45,7 @@ pub fn params_not_editable_translation(language: Language) -> &'static str {
Language::IT => "I seguenti parametri non sono modificabili durante l'analisi",
Language::FR => "Les paramètres suivants ne peuvent pas être modifiés durant l'analyse",
Language::DE => "Die folgenden Paramter können während der Analyse nicht verändert werden",
Language::PL => "Następujące parametry nie mogą być modyfikowane podczas analizy",
_ => "The following parameters can't be modified during the analysis",
}
}
Expand All @@ -52,6 +56,7 @@ pub fn params_not_editable_translation(language: Language) -> &'static str {
// Language::IT => "Percorso del file",
// Language::FR => "Chemin du fichier",
// Language::DE => "Dateipfad",
// Language::PL => "Ścieżka pliku",
// _ => "File path",
// }
// }
Expand All @@ -63,6 +68,7 @@ pub fn custom_style_translation(language: Language) -> &'static str {
Language::IT => "Stile personalizzato",
Language::FR => "Style personnalisé",
Language::DE => "Benutzerdefinierter Stil",
Language::PL => "Niestandardowy styl",
_ => "Custom style",
}
}
Expand All @@ -73,13 +79,14 @@ pub fn copy_translation(language: Language) -> &'static str {
Language::IT | Language::ES => "Copia",
Language::FR => "Copie",
Language::DE => "Kopieren",
Language::PL => "Kopiuj",
_ => "Copy",
}
}

pub fn port_translation(language: Language) -> &'static str {
match language {
Language::EN | Language::FR | Language::DE => "Port",
Language::EN | Language::FR | Language::DE | Language::PL => "Port",
Language::ES => "Puerto",
Language::IT => "Porta",
_ => "Port",
Expand All @@ -93,6 +100,7 @@ pub fn invalid_filters_translation(language: Language) -> &'static str {
Language::IT => "Filtri non validi",
Language::FR => "Filtres invalides",
Language::DE => "Ungültige Filter",
Language::PL => "Nieprawidłowe filtry",
_ => "Invalid filters",
}
}
Expand All @@ -103,6 +111,7 @@ pub fn messages_translation(language: Language) -> &'static str {
Language::ES => "Mensajes",
Language::IT => "Messaggi",
Language::DE => "Nachrichten",
Language::PL => "Wiadomości",
_ => "Messages",
}
}
Expand All @@ -114,6 +123,7 @@ pub fn link_type_translation(language: Language) -> &'static str {
Language::IT => "Tipo di collegamento",
Language::FR => "Type de connexion",
Language::DE => "Verbindungsart",
Language::PL => "Rodzaj połączenia", // "Typ łącza"?
_ => "Link type",
}
}
Expand All @@ -128,6 +138,7 @@ pub fn unsupported_link_type_translation(
Language::IT => "Il tipo di collegamento associato a questo adattatore di rete non è ancora supportato da Sniffnet...",
Language::FR => "Le type de connexion associé à cet adaptateur n'est pas encore supporté par Sniffnet...",
Language::DE => "Die Verbindungsart dieses Adapters wird noch nicht von Sniffnet unterstützt",
Language::PL => "Rodzaj połączenia powiązany z tym adapterem nie jest jeszcze obsługiwany przez Sniffnet...",
_ => "The link type associated with this adapter is not supported by Sniffnet yet...",
}.to_string();

Expand All @@ -143,6 +154,7 @@ pub fn style_from_file_translation(language: Language) -> &'static str {
Language::IT => "Seleziona lo stile da un file",
Language::FR => "Sélectionner un style à partir d'un fichier",
Language::DE => "Stil aus einer Datei wählen",
Language::PL => "Wybierz styl z pliku",
_ => "Select style from a file",
}
}
Expand All @@ -154,6 +166,7 @@ pub fn database_from_file_translation(language: Language) -> &'static str {
Language::IT => "Seleziona file di database",
Language::FR => "Sélection d'un fichier de base de données",
Language::DE => "Datenbank Datei auswählen",
Language::PL => "Wybierz plik bazy danych",
_ => "Select database file",
}
}
Expand All @@ -165,6 +178,7 @@ pub fn filter_by_host_translation(language: Language) -> &'static str {
Language::IT => "Filtra per host di rete",
Language::FR => "Filtrer par réseau hôte",
Language::DE => "Nach Netzwerk-Host filtern",
Language::PL => "Filtruj według hosta sieciowego",
_ => "Filter by network host",
}
}
Expand All @@ -174,6 +188,7 @@ pub fn service_translation(language: Language) -> &'static str {
Language::EN | Language::FR | Language::DE => "Service",
Language::ES => "Servicio",
Language::IT => "Servizio",
Language::PL => "Usługa",
_ => "Service",
}
}
Expand All @@ -184,6 +199,7 @@ pub fn export_capture_translation(language: Language) -> &'static str {
Language::IT => "Esporta file di cattura",
Language::FR => "Exporter le fichier de capture",
Language::DE => "Aufzeichnungsdatei exportieren",
Language::PL => "Eksportuj plik przechwytywania",
_ => "Export capture file",
}
}
Expand All @@ -195,6 +211,7 @@ pub fn directory_translation(language: Language) -> &'static str {
Language::IT => "Cartella",
Language::FR => "Répertoire",
Language::DE => "Ordner",
Language::PL => "Katalog", // Katalog usually refers to Linux based directory while "Folder" is more common between Windows users (e.g. windows explorer refers to directories as "Folders")
_ => "Directory",
}
}
Expand All @@ -205,6 +222,7 @@ pub fn select_directory_translation(language: Language) -> &'static str {
Language::IT => "Seleziona cartella di destinazione",
Language::FR => "Sélectionner le répertoire de destination",
Language::DE => "Zielorder wählen",
Language::PL => "Wybierz katalog docelowy", // "Wybierz folder docelowy"?
_ => "Select destination directory",
}
}
Expand All @@ -215,6 +233,7 @@ pub fn file_name_translation(language: Language) -> &'static str {
Language::IT => "Nome del file",
Language::FR => "Nom du fichier",
Language::DE => "Dateiname",
Language::PL => "Nazwa pliku",
_ => "File name",
}
}
Expand All @@ -225,6 +244,7 @@ pub fn thumbnail_mode_translation(language: Language) -> &'static str {
Language::IT => "Modalità miniatura",
Language::FR => "Mode miniature",
Language::DE => "Bild-in-Bild Modus",
Language::PL => "Tryb miniatury",
_ => "Thumbnail mode",
}
}
Expand All @@ -235,6 +255,7 @@ pub fn learn_more_translation(language: Language) -> &'static str {
Language::IT => "Vuoi saperne di più?",
Language::FR => "Voulez-vous en savoir davantage?",
Language::DE => "Mehr erfahren",
Language::PL => "Chcesz dowiedzieć się więcej?",
_ => "Do you want to learn more?",
}
}
2 changes: 1 addition & 1 deletion src/translations/types/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Language {
pub fn is_up_to_date(self) -> bool {
matches!(
self,
Language::FR | Language::EN | Language::IT | Language::DE
Language::FR | Language::EN | Language::IT | Language::DE | Language::PL
)
}
}
Expand Down