Skip to content

Commit

Permalink
added turkish characters and language; fixed errors and added third l…
Browse files Browse the repository at this point in the history
…anguage column
  • Loading branch information
GyulyVGC committed Apr 13, 2023
1 parent dfb688c commit c61668d
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 22 deletions.
6 changes: 6 additions & 0 deletions resources/fonts/full/subset_characters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ z
¿
Ê
Î
Ö
Ü
à
á
Expand All @@ -120,9 +121,14 @@ 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.
5 changes: 4 additions & 1 deletion src/gui/pages/settings_language_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
language_radios(language_active, &Language::COL1, font, sniffer.style);
let col_language_radio_2 =
language_radios(language_active, &Language::COL2, font, sniffer.style);
let col_language_radio_3 =
language_radios(language_active, &Language::COL3, font, sniffer.style);
let row_language_radio = Row::new()
.spacing(50)
.push(col_language_radio_1)
.push(col_language_radio_2);
.push(col_language_radio_2)
.push(col_language_radio_3);

let content = Column::new()
.align_items(Alignment::Center)
Expand Down
12 changes: 5 additions & 7 deletions src/translations/translations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ pub fn address_translation(language: Language) -> &'static str {
Language::IT => "\nIndirizzo:",
Language::FR | Language::DE => "\nAdresse:",
Language::ES => "\nDirección:",
Language::PL => "\nAdres:",
Language::PL | Language::TR => "\nAdres:",
Language::UK => "\nАдреса:",
Language::ZH => "\n网络地址:",
Language::RO => "\nAdresă:",
Language::KO => "\n주소:",
Language::TR => "\nAdres:",
}
}

Expand Down Expand Up @@ -382,7 +381,7 @@ pub fn some_observed_translation(
Language::KO => format!("감지한 총 패킷: {observed}\n\n\
필터링된 패킷: 0\n\n\
일부 패킷이 감지되었지만, 지정한 필터에 따라 선택되지 않았습니다...\n\n{filters}"),
Language::TR => format!("Toplam yakalanan paketler: {observerd}\n\n\
Language::TR => format!("Toplam yakalanan paketler: {observed}\n\n\
Filterelenen paketler: 0\n\n\
Bazı paketler yakalandı, fakat belirttiğiniz filtrelere göre hiç biri seçilmedi...\n\n{filters}")
})
Expand Down Expand Up @@ -412,7 +411,7 @@ pub fn filtered_packets_translation(
Language::KO => {
format!("필터링된 패킷:\n {filtered} ({percentage} 의 일부)")
}
Language::TR => format!("Filtrelenen paketler: \n {filtered} toplamın ({percentage})"),
Language::TR => format!("Filtrelenen paketler:\n {filtered} toplamın ({percentage})"),
})
}

Expand Down Expand Up @@ -735,7 +734,7 @@ pub fn active_filters_translation(language: Language) -> &'static str {
Language::ZH => "活动的过滤器:",
Language::RO => "Filtre active:",
Language::KO => "활성화된 필터:",
Language::TR => "Aktif filtreler",
Language::TR => "Aktif filtreler:",
}
}

Expand Down Expand Up @@ -872,11 +871,10 @@ pub fn style_translation(language: Language) -> &'static str {
Language::IT => "Stile",
Language::ES => "Estilo",
Language::PL => "Styl",
Language::DE | Language::RO => "Stil",
Language::DE | Language::RO | Language::TR => "Stil",
Language::UK => "Стиль",
Language::ZH => "主题",
Language::KO => "스타일",
Language::TR => "Stil",
}
}

Expand Down
20 changes: 6 additions & 14 deletions src/translations/types/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub enum Language {
RO,
/// Korean
KO,
/// Turkish
TR,
}

impl Default for Language {
Expand All @@ -32,20 +34,9 @@ impl Default for Language {
}

impl Language {
pub(crate) const COL1: [Language; 5] = [
Language::EN,
Language::ES,
Language::IT,
Language::PL,
Language::UK,
];
pub(crate) const COL2: [Language; 5] = [
Language::DE,
Language::FR,
Language::KO,
Language::RO,
Language::ZH,
];
pub(crate) const COL1: [Language; 4] = [Language::EN, Language::FR, Language::PL, Language::UK];
pub(crate) const COL2: [Language; 4] = [Language::DE, Language::IT, Language::RO, Language::ZH];
pub(crate) const COL3: [Language; 3] = [Language::ES, Language::KO, Language::TR];

pub fn get_radio_label(&self) -> &str {
match self {
Expand All @@ -59,6 +50,7 @@ impl Language {
Language::ZH => "简体中文",
Language::RO => "Română",
Language::KO => "한국인",
Language::TR => "Türkçe",
}
}
}
1 change: 1 addition & 0 deletions src/utils/countries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ pub fn get_flag_from_language_code(language: &str) -> Image {
"KO" => KR,
"PL" => PL,
"RO" => RO,
"TR" => TR,
"UK" => UA,
_ => UNKNOWN,
})))
Expand Down

2 comments on commit c61668d

@fuzunspm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the mistakes

@GyulyVGC
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the mistakes

don't worry man!

Please sign in to comment.