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

Swedish translation #213

Merged
merged 4 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions resources/fonts/full/subset_characters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ z
}
¡
¿
Ä
Ê
Î
Ö
Expand All @@ -103,6 +104,7 @@ 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.
46 changes: 25 additions & 21 deletions src/gui/components/radio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::notifications::types::sound::Sound;
use crate::translations::translations::{
ip_version_translation, sound_translation, transport_protocol_translation,
};
use crate::utils::countries::get_flag_from_language_code;
use crate::utils::countries::get_flag_from_language;
use crate::{ChartType, IpVersion, Language, StyleType, TransProtocol};

pub fn ip_version_radios(
Expand Down Expand Up @@ -83,29 +83,33 @@ pub fn language_radios(
collection: &[Language],
font: Font,
style: StyleType,
) -> Column<'static, Message> {
let mut ret_val = Column::new().spacing(10);
) -> Row<'static, Message> {
let mut ret_val = Row::new().spacing(10);
for option in collection {
ret_val = ret_val.push(
Row::new()
.align_items(Alignment::Center)
.push(
Radio::new(
format!("{} ({:?})", option.get_radio_label(), option),
*option,
Some(active),
Message::LanguageSelection,
Row::new().align_items(Alignment::Center).push(
Row::new()
.width(Length::Fixed(180.0))
.push(
Radio::new(
format!("{} ({:?})", option.get_radio_label(), option),
*option,
Some(active),
Message::LanguageSelection,
)
.spacing(7)
.font(font)
.size(15)
.style(
<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
)),
),
)
.spacing(7)
.font(font)
.size(15)
.style(<StyleTuple as Into<iced::theme::Radio>>::into(StyleTuple(
style,
ElementType::Standard,
))),
)
.push(horizontal_space(Length::Fixed(8.0)))
.push(get_flag_from_language_code(&format!("{option:?}"))),
.push(horizontal_space(Length::Fixed(8.0)))
.push(get_flag_from_language(*option)),
),
);
}
ret_val
Expand Down
31 changes: 17 additions & 14 deletions src/gui/pages/settings_language_page.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use iced::widget::{Column, Container, Row, Text};
use iced::widget::{Column, Container, Text};
use iced::Length::Fixed;
use iced::{Alignment, Length};
use iced_native::widget::vertical_space;
Expand All @@ -18,17 +18,20 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
let font = get_font(sniffer.style);

let language_active = sniffer.language;
let col_language_radio_1 =
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_3);
let row_language_radio_1 =
language_radios(language_active, &Language::ROW1, font, sniffer.style);
let row_language_radio_2 =
language_radios(language_active, &Language::ROW2, font, sniffer.style);
let row_language_radio_3 =
language_radios(language_active, &Language::ROW3, font, sniffer.style);
let row_language_radio_4 =
language_radios(language_active, &Language::ROW4, font, sniffer.style);
let col_language_radio_all = Column::new()
.spacing(20)
.push(row_language_radio_1)
.push(row_language_radio_2)
.push(row_language_radio_3)
.push(row_language_radio_4);

let mut content = Column::new()
.align_items(Alignment::Center)
Expand Down Expand Up @@ -58,7 +61,7 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
)
.push(vertical_space(Fixed(20.0)));

if ![Language::EN, Language::IT].contains(&sniffer.language) {
if ![Language::EN, Language::IT, Language::SV].contains(&sniffer.language) {
content = content
.push(
Container::new(
Expand All @@ -73,7 +76,7 @@ pub fn settings_language_page(sniffer: &Sniffer) -> Container<Message> {
.push(vertical_space(Fixed(20.0)));
}

content = content.push(row_language_radio);
content = content.push(col_language_radio_all);

Container::new(content)
.height(Fixed(400.0))
Expand Down
Loading