Skip to content

Commit

Permalink
updated settings language page
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Oct 21, 2023
1 parent 764fa30 commit 3a67964
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/gui/components/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn language_radios(
Row::new().align_items(Alignment::Center).push(
Row::new()
.align_items(Alignment::Center)
.width(Length::Fixed(180.0))
.width(Length::Fixed(200.0))
.push(
Radio::new(
format!("{} ({:?})", option.get_radio_label(), option),
Expand All @@ -91,7 +91,7 @@ pub fn language_radios(
.font(font)
.size(15),
)
.push(horizontal_space(Length::Fixed(8.0)))
.push(horizontal_space(Length::Fixed(15.0)))
.push(option.get_flag()),
),
);
Expand Down
9 changes: 5 additions & 4 deletions src/gui/pages/settings_language_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,16 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message, Renderer<
let row_language_radio_3 = language_radios(language_active, &Language::ROW3, font);
let row_language_radio_4 = language_radios(language_active, &Language::ROW4, font);
let row_language_radio_5 = language_radios(language_active, &Language::ROW5, font);
let row_language_radio_6 = language_radios(language_active, &Language::ROW6, font);
let col_language_radio_all = Column::new()
.spacing(10)
.spacing(12)
.align_items(Alignment::Center)
.push(row_language_radio_1)
.push(vertical_space(0))
.push(row_language_radio_2)
.push(row_language_radio_3)
.push(row_language_radio_4)
.push(row_language_radio_5);
.push(row_language_radio_5)
.push(row_language_radio_6);

let mut content = Column::new()
.align_items(Alignment::Center)
Expand All @@ -59,7 +60,7 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message, Renderer<
.push(col_language_radio_all);

if [Language::EL, Language::PT].contains(&sniffer.language) {
content = content.push(vertical_space(Fixed(40.0))).push(
content = content.push(vertical_space(Fixed(20.0))).push(
Container::new(
Text::new("The selected language is not fully updated to version 1.2").font(font),
)
Expand Down
4 changes: 2 additions & 2 deletions src/translations/translations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ pub fn no_addresses_translation(
Language::JA => format!("選択されたアダプターが有効なアドレスを持っていないため、トラフィックを観測できていません...\n\n\
ネットワーク アダプター: {adapter}\n\n\
インターネットに接続しているか確認し、別のネットワーク アダプターを試してください。"),
Language::UZ => format!("Trafik kuzatilmaydi, chunki siz tanlagan adapterda faol manzillar yoq...\n\n\
Language::UZ => format!("Trafik kuzatilmaydi, chunki siz tanlagan adapterda faol manzillar yo'q...\n\n\
Tarmoq adapteri: {adapter}\n\n\
Internetga ulanganingizga ishonchingiz komil bo'lsa, boshqa adapterni tanlashga harakat qiling"),
})
Expand Down Expand Up @@ -765,7 +765,7 @@ pub fn of_total_translation(language: Language, percentage: &str) -> String {
// برای افزودن یک پیوند به پسندیده های خود، روی نشان ستاره کنار پیوند کلیک کنید.",
// Language::SE => "Inget att visa för tillfälet.\n\
// För att lägga till anslutningar till dina favoriter, klicka på stjärnsymbolen nära anslutningen.",
// Language::UZ => "Ayni paytda korsatiladigan hech narsa yoq.\n\
// Language::UZ => "Ayni paytda ko'rsatiladigan hech narsa yo'q.\n\
// Ulanishni sevimlilar ro'yhatiga qo'shish uchun ulanish yaqinidagi yulduzcha belgisini bosing."
// })
// }
Expand Down
15 changes: 8 additions & 7 deletions src/translations/types/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub enum Language {
FI,
/// Japanese
JA,
/// O'zbek tili
/// Uzbek
UZ,
}

Expand All @@ -58,11 +58,12 @@ impl Default for Language {
}

impl Language {
pub(crate) const ROW1: [Language; 2] = [Language::EN, Language::UZ];
pub(crate) const ROW2: [Language; 4] = [Language::DE, Language::EL, Language::ES, Language::FI];
pub(crate) const ROW3: [Language; 4] = [Language::FR, Language::IT, Language::JA, Language::KO];
pub(crate) const ROW4: [Language; 4] = [Language::PL, Language::PT, Language::RO, Language::RU];
pub(crate) const ROW5: [Language; 4] = [Language::SV, Language::TR, Language::UK, Language::ZH];
pub(crate) const ROW1: [Language; 3] = [Language::EN, Language::DE, Language::EL];
pub(crate) const ROW2: [Language; 3] = [Language::ES, Language::FI, Language::FR];
pub(crate) const ROW3: [Language; 3] = [Language::IT, Language::JA, Language::KO];
pub(crate) const ROW4: [Language; 3] = [Language::PL, Language::PT, Language::RO];
pub(crate) const ROW5: [Language; 3] = [Language::RU, Language::SV, Language::TR];
pub(crate) const ROW6: [Language; 3] = [Language::UK, Language::UZ, Language::ZH];

pub fn get_radio_label(&self) -> &str {
match self {
Expand All @@ -84,7 +85,7 @@ impl Language {
Language::SV => "Svenska",
Language::FI => "Suomi",
Language::JA => "日本語",
Language::UZ => "O'zbek tili",
Language::UZ => "O'zbekcha",
}
}

Expand Down

0 comments on commit 3a67964

Please sign in to comment.