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

chore: add Simplified Chinese translation #89

Merged
merged 6 commits into from
Feb 27, 2023
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
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,6 @@ $RECYCLE.BIN/

#####################################################################

# report file generated by the application and country database
*.txt
*.csv

#folder with reports
/sniffnet_*

#folder used for Windows installer
/wix

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/GyulyVGC/sniffnet"
license = "MIT OR Apache-2.0"
keywords = ["filter", "network", "packet", "sniffer", "gui"]
categories = ["visualization", "gui", "network-programming"]
include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md", "resources/countries_flags/**/*", "resources/DB/GeoLite2-Country.mmdb", "resources/palettes/*", "resources/fonts/*", "resources/sounds/*"]
include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md", "resources/countries_flags/**/*", "resources/DB/GeoLite2-Country.mmdb", "resources/palettes/*", "resources/fonts/subset/*", "resources/sounds/*"]


[package.metadata.bundle]
Expand Down
Binary file added resources/fonts/full/LXGWWenKaiMonoLite-Bold.ttf
Binary file not shown.
Binary file not shown.
313 changes: 313 additions & 0 deletions resources/fonts/full/subset_characters.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,313 @@

!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_
`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
¡
¿
Ê
Ü
à
á
ä
ç
è
é
ê
ì
í
ñ
ó
ô
ö
ù
ú
û
ü
ą
ć
ę
ł
ń
ś
ź
ż
使
退
Binary file removed resources/fonts/inconsolata-bold.ttf
Binary file not shown.
Binary file removed resources/fonts/inconsolata-regular.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
6 changes: 5 additions & 1 deletion src/enums/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ pub enum Language {
PL,
/// German,
DE,
/// Simplified Chinese
CN,
}

impl Default for Language {
Expand All @@ -24,8 +26,9 @@ impl Default for Language {
}

impl Language {
pub(crate) const COL1: [Language; 3] = [Language::EN, Language::ES, Language::FR];
pub(crate) const COL1: [Language; 3] = [Language::EN, Language::FR, Language::ES];
pub(crate) const COL2: [Language; 3] = [Language::DE, Language::IT, Language::PL];
pub(crate) const COL3: [Language; 1] = [Language::CN];
pub fn get_radio_label(&self) -> &str {
match self {
Language::EN => "English",
Expand All @@ -34,6 +37,7 @@ impl Language {
Language::ES => "Español",
Language::PL => "Polski",
Language::DE => "Deutsch",
Language::CN => "简体中文",
}
}
}
6 changes: 3 additions & 3 deletions src/gui/pages/overview_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::utility::get_formatted_strings::{
get_active_filters_string, get_active_filters_string_nobr, get_app_count_string,
get_connection_color, get_formatted_bytes_string, get_percentage_string, get_report_path,
};
use crate::utility::style_constants::{get_font, HEIGHT_BODY, ICONS, INCONSOLATA_BOLD};
use crate::utility::style_constants::{get_font, HEIGHT_BODY, ICONS, LXGW_MONO_LITE_BOLD};
use crate::utility::translations::{
error_translation, filtered_application_translation, filtered_bytes_translation,
filtered_packets_translation, no_addresses_translation, no_favorites_translation,
Expand Down Expand Up @@ -225,15 +225,15 @@ pub fn overview_page(sniffer: &Sniffer) -> Container<Message> {
key_val.1.print_gui()
))
.style(iced::theme::Text::Color(entry_color))
.font(INCONSOLATA_BOLD),
.font(LXGW_MONO_LITE_BOLD),
);
if key_val.1.country.is_empty() {
entry_row = entry_row
.push(
Text::new("?")
.width(Length::Fixed(FLAGS_WIDTH))
.style(iced::theme::Text::Color(entry_color))
.font(INCONSOLATA_BOLD),
.font(LXGW_MONO_LITE_BOLD),
)
.push(Text::new(" "));
} else {
Expand Down
Loading