RR: Translate Manual partition page

This commit is contained in:
Ward from fusion-voyager-3 2024-02-18 22:36:24 +03:00
parent 90941b2eb1
commit 00cadafc29
7 changed files with 127 additions and 37 deletions

View File

@ -1,5 +1,7 @@
#! /bin/bash #! /bin/bash
export LANG=en_US.UTF8
set -e set -e
DISK="$(cat "/tmp/pika-installer-gtk4-target-auto.txt")" DISK="$(cat "/tmp/pika-installer-gtk4-target-auto.txt")"

View File

@ -1,5 +1,7 @@
#! /bin/bash #! /bin/bash
export LANG=en_US.UTF8
exec &> >(tee /tmp/pika-installer-gtk4-log) exec &> >(tee /tmp/pika-installer-gtk4-log)
if [[ -f /tmp/pika-installer-gtk4-target-manual.txt ]] if [[ -f /tmp/pika-installer-gtk4-target-manual.txt ]]

View File

@ -1,5 +1,7 @@
#! /bin/bash #! /bin/bash
export LANG=en_US.UTF8
set -e set -e
LOCALE="$(cat "/tmp/pika-installer-gtk4-lang.txt")" LOCALE="$(cat "/tmp/pika-installer-gtk4-lang.txt")"

View File

@ -1,5 +1,7 @@
#! /bin/bash #! /bin/bash
export LANG=en_US.UTF8
if [[ "$1" = "get_block_devices" ]] if [[ "$1" = "get_block_devices" ]]
then then
lsblk -dn -o NAME | grep -v -i -E 'loop|zram|sr|cdrom|portal' lsblk -dn -o NAME | grep -v -i -E 'loop|zram|sr|cdrom|portal'

View File

@ -54,3 +54,86 @@ msgstr "Manually Partition The Drive"
msgid "auto_partition_drive" msgid "auto_partition_drive"
msgstr "Automatically Partition\nThe Drive" msgstr "Automatically Partition\nThe Drive"
msgid "manual_part_installer"
msgstr "Manual Partitioning Installer"
msgid "use_utility_manual"
msgstr "Use this utility to partition/mount/format your drives."
msgid "open_gparted"
msgstr "Open GPARTED"
msgid "manual_part_note"
msgstr "\n - Press the plus button below to begin adding filesystem entries.\nNotes:\n - This installer doesn't erase any data automatically, format your drives manually via gparted.\n - To Add a linux-swap partition set mountpoint to [SWAP]\n - We recommend the following partitions as a base layout:\n /boot ~ 1000mb ext4.\n /boot/efi ~ 512mb vfat/fat32.\n / >= 25GB btrfs.\n "
msgid "refresh_part_table"
msgstr "Refresh Partition Table"
msgid "validate_fs_table"
msgstr "Validate Filesystem Table"
msgid "fstab_status_valid"
msgstr "Filesystem Table Status: All entries are valid!"
msgid "part_need_mapper"
msgstr "This partition needs a mapper!"
msgid "fstab_subvol_warn"
msgstr "Filesystem Table Warning: Partition reuse check will be skipped due to subvol usage."
msgid "fstab_multiple_part_mountpoint_err"
msgstr "Filesystem Table Error: Multiple partitions are configured to the same mountpoint!"
msgid "fstab_no_mountpoint_err"
msgstr "Filesystem Table Error: One or more partitions don't have a mountpoint configured!"
msgid "fstab_no_partition_err"
msgstr "Filesystem Table Error: One or more entries don't have a partition configured!"
msgid "fstab_badfs"
msgstr "Filesystem Table Error: Invalid filesystem: (/dev/"
msgstr "fstab_small_efi_err"
msgstr "Filesystem Table Error: Small size: The partition mounted to /boot/efi (/dev/"
msgid "fstab_small_efi_size"
msgstr ") Must at least be 512MBs!"
msgid "fstab_badfs_efi"
msgstr ") Must be FAT32/vFAT to be mounted at /boot/efi!"
msgstr "fstab_small_boot_err"
msgstr "Filesystem Table Error: Small size: The partition mounted to /boot (/dev/"
msgid "fstab_small_boot_size"
msgstr ") Must at least be 1GBs!"
msgid "fstab_badfs_boot"
msgstr ") Must not be FAT32/vFAT to be mounted at /boot!"
msgstr "fstab_small_root_err"
msgstr "Filesystem Table Error: Small size: The partition mounted to / (/dev/"
msgid "fstab_small_root_size"
msgstr ") Must at least be 26GBs!"
msgid "fstab_badfs_root"
msgstr ") Must be a Linux* compatible filesystem such as:\n ext4/btrfs/xfs/f2fs to be mounted at /!"
msgstr "fstab_small_home_err"
msgstr "Filesystem Table Error: Small size: The partition mounted to /home (/dev/"
msgid "fstab_small_home_size"
msgstr ") Must at least be 11GBs!"
msgid "fstab_badfs_home"
msgstr ") Must be a Linux* compatible filesystem such as:\n ext4/btrfs/xfs/f2fs to be mounted at /home!"
msgid "fstab_badfs_swap"
msgstr ") Must not be swap to be used as [SWAP]!"
msgid "fstab_bad_mountpoint"
msgstr "Filesystem Table Error: Invalid mountpoint: ("
msgid "fstab_bad_mountpoint_msg"
msgstr ") Is not a valid mountpoint!"

View File

@ -43,7 +43,7 @@ pub fn automatic_partitioning(
// the header icon for the partitioning icon // the header icon for the partitioning icon
let partition_method_automatic_header_icon = gtk::Image::builder() let partition_method_automatic_header_icon = gtk::Image::builder()
.icon_name("media-playlist-shuffle") .icon_name("builder")
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.hexpand(true) .hexpand(true)
.pixel_size(78) .pixel_size(78)

View File

@ -84,7 +84,7 @@ fn create_mount_row(
.activatable_widget(&partition_button) .activatable_widget(&partition_button)
.title(partition.clone()) .title(partition.clone())
.name(partition.clone()) .name(partition.clone())
.subtitle("This partition needs a mapper!") .subtitle(gettext("part_need_mapper"))
.build(); .build();
prow prow
} else { } else {
@ -151,7 +151,7 @@ pub fn manual_partitioning(
// the header text for the partitioning page // the header text for the partitioning page
let partition_method_manual_header_text = gtk::Label::builder() let partition_method_manual_header_text = gtk::Label::builder()
.label("Manual Partitioning Installer") .label(gettext("manual_part_installer"))
.halign(gtk::Align::End) .halign(gtk::Align::End)
.hexpand(true) .hexpand(true)
.margin_top(15) .margin_top(15)
@ -163,7 +163,7 @@ pub fn manual_partitioning(
// the header icon for the partitioning icon // the header icon for the partitioning icon
let partition_method_manual_header_icon = gtk::Image::builder() let partition_method_manual_header_icon = gtk::Image::builder()
.icon_name("input-tablet") .icon_name("org.gnome.Settings")
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.hexpand(true) .hexpand(true)
.pixel_size(78) .pixel_size(78)
@ -182,11 +182,11 @@ pub fn manual_partitioning(
.build(); .build();
let partition_method_manual_gparted_button_content_text = gtk::Label::builder() let partition_method_manual_gparted_button_content_text = gtk::Label::builder()
.label("Use this utility to partition/mount/format your drives.") .label(gettext("use_utility_manual"))
.build(); .build();
let partition_method_manual_gparted_button_content = adw::ButtonContent::builder() let partition_method_manual_gparted_button_content = adw::ButtonContent::builder()
.label("Open GPARTED") .label(gettext("open_gparted"))
.icon_name("gparted") .icon_name("gparted")
.build(); .build();
@ -216,7 +216,7 @@ pub fn manual_partitioning(
.build(); .build();
let partition_method_manual_selection_text = gtk::Label::builder() let partition_method_manual_selection_text = gtk::Label::builder()
.label("\n - Press the plus button below to begin adding filesystem entries.\nNotes:\n - This installer doesn't erase any data automatically, format your drives manually via gparted.\n - To Add a linux-swap partition set mountpoint to [SWAP]\n - We recommend the following partitions as a base layout:\n /boot ~ 1000mb ext4.\n /boot/efi ~ 512mb vfat/fat32.\n / >= 25GB btrfs.\n ") .label(gettext("manual_part_note"))
.halign(gtk::Align::Center) .halign(gtk::Align::Center)
.hexpand(true) .hexpand(true)
.margin_top(15) .margin_top(15)
@ -227,13 +227,13 @@ pub fn manual_partitioning(
partition_method_manual_selection_text.add_css_class("medium_sized_text"); partition_method_manual_selection_text.add_css_class("medium_sized_text");
let partition_refresh_button = gtk::Button::builder() let partition_refresh_button = gtk::Button::builder()
.label("Refresh Partition Table") .label(gettext("refresh_part_table"))
.halign(gtk::Align::End) .halign(gtk::Align::End)
.build(); .build();
partition_refresh_button.add_css_class("destructive-action"); partition_refresh_button.add_css_class("destructive-action");
let fstab_valid_check = gtk::Button::builder() let fstab_valid_check = gtk::Button::builder()
.label("Validate Filesystem Table") .label(gettext("validate_fs_table"))
.halign(gtk::Align::Start) .halign(gtk::Align::Start)
.build(); .build();
fstab_valid_check.add_css_class("valid-action"); fstab_valid_check.add_css_class("valid-action");
@ -257,7 +257,7 @@ pub fn manual_partitioning(
.valign(Align::End) .valign(Align::End)
.vexpand(true) .vexpand(true)
.visible(false) .visible(false)
.label("Filesystem Table is valid!") .label(gettext("fstab_status_valid"))
.build(); .build();
partition_method_manual_valid_label.add_css_class("small_valid_text"); partition_method_manual_valid_label.add_css_class("small_valid_text");
@ -366,13 +366,13 @@ pub fn manual_partitioning(
if *check_part_unique.borrow_mut() == true { if *check_part_unique.borrow_mut() == true {
row_scrw.set_sensitive(false) row_scrw.set_sensitive(false)
} else if row_scrw.property::<String>("subtitle").contains("This partition needs a mapper!") { } else if row_scrw.property::<String>("subtitle").contains(&gettext("part_need_mapper")) {
row_scrw.set_sensitive(false) row_scrw.set_sensitive(false)
} else { } else {
row_scrw.set_sensitive(true) row_scrw.set_sensitive(true)
} }
} }
else if row_scrw.property::<String>("subtitle").contains("This partition needs a mapper!") { else if row_scrw.property::<String>("subtitle").contains(&gettext("part_need_mapper")) {
row_scrw.set_sensitive(false) row_scrw.set_sensitive(false)
} else { } else {
row_scrw.set_sensitive(true) row_scrw.set_sensitive(true)
@ -397,7 +397,7 @@ pub fn manual_partitioning(
if *check_part_unique.borrow_mut() == false { if *check_part_unique.borrow_mut() == false {
partition_method_manual_warn_label partition_method_manual_warn_label
.set_label("Partition reuse check will be skipped due to subvol usage."); .set_label(&gettext("fstab_subvol_warn"));
partition_method_manual_warn_label.set_visible(true); partition_method_manual_warn_label.set_visible(true);
} else { } else {
partition_method_manual_warn_label.set_visible(false); partition_method_manual_warn_label.set_visible(false);
@ -474,7 +474,7 @@ fn partition_err_check(
{ {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label partition_method_manual_error_label
.set_label("Multiple drives were mounted to the same mountpoint."); .set_label(&gettext("fstab_multiple_part_mountpoint_err"));
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err0"); partition_method_manual_error_label.set_widget_name("err0");
} }
@ -486,7 +486,7 @@ fn partition_err_check(
} else { } else {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label partition_method_manual_error_label
.set_label("Some drives don't have a mountpoint configured."); .set_label(&gettext("fstab_no_mountpoint_err"));
partition_method_manual_error_label.set_widget_name("err1"); partition_method_manual_error_label.set_widget_name("err1");
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
} }
@ -495,7 +495,7 @@ fn partition_err_check(
if empty_partition == true { if empty_partition == true {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label partition_method_manual_error_label
.set_label("There's a drive row without a partition."); .set_label(&gettext("fstab_no_partition_err"));
partition_method_manual_error_label.set_widget_name("err2"); partition_method_manual_error_label.set_widget_name("err2");
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
} }
@ -538,9 +538,9 @@ fn partition_err_check(
if partition_size < 500000000.0 { if partition_size < 500000000.0 {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Small size: The partition mounted to /boot/efi (/dev/".to_owned() &(gettext("fstab_small_efi_err")
+ &drivemounts.partition + &drivemounts.partition
+ ") Must at least be 512MBs"), + &gettext("fstab_small_efi_size")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err3"); partition_method_manual_error_label.set_widget_name("err3");
@ -553,10 +553,9 @@ fn partition_err_check(
if partition_fs != "vfat" { if partition_fs != "vfat" {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Bad Filesystem: The partition mounted to /boot/efi (/dev/" &(gettext("fstab_badfs")
.to_owned()
+ &drivemounts.partition + &drivemounts.partition
+ ") Must at be FAT32/vFAT"), + &gettext("fstab_badfs_efi")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err4"); partition_method_manual_error_label.set_widget_name("err4");
@ -571,9 +570,9 @@ fn partition_err_check(
if partition_size < 1000000000.0 { if partition_size < 1000000000.0 {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Small size: The partition mounted to /boot (/dev/".to_owned() &(gettext("fstab_small_boot_err")
+ &drivemounts.partition + &drivemounts.partition
+ ") Must at least be 1000MBs"), + &gettext("fstab_small_boot_size")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err5"); partition_method_manual_error_label.set_widget_name("err5");
@ -586,9 +585,9 @@ fn partition_err_check(
if partition_fs == "vfat" { if partition_fs == "vfat" {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Bad Filesystem: The partition mounted to /boot (/dev/".to_owned() &(gettext("fstab_badfs")
+ &drivemounts.partition + &drivemounts.partition
+ ") Cannot be FAT32/vFAT"), + &gettext("fstab_badfs_boot")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err6"); partition_method_manual_error_label.set_widget_name("err6");
@ -603,9 +602,9 @@ fn partition_err_check(
if partition_size < 25000000000.0 { if partition_size < 25000000000.0 {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Small size: The partition mounted to / (/dev/".to_owned() &(gettext("fstab_small_root_err")
+ &drivemounts.partition + &drivemounts.partition
+ ") Must at least be 25GBs"), + &gettext("fstab_small_root_size")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err7") partition_method_manual_error_label.set_widget_name("err7")
@ -618,9 +617,9 @@ fn partition_err_check(
if partition_fs == "vfat" || partition_fs == "ntfs" || partition_fs == "swap" || partition_fs == "exfat" { if partition_fs == "vfat" || partition_fs == "ntfs" || partition_fs == "swap" || partition_fs == "exfat" {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Bad Filesystem: The partition mounted to / (/dev/".to_owned() &(gettext("fstab_badfs")
+ &drivemounts.partition + &drivemounts.partition
+ ") Has an Invalid Filesystem"), + &gettext("fstab_badfs_root")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err8"); partition_method_manual_error_label.set_widget_name("err8");
@ -635,9 +634,9 @@ fn partition_err_check(
if partition_size < 10000000000.0 { if partition_size < 10000000000.0 {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Small size: The partition mounted to /home (/dev/".to_owned() &(gettext("fstab_small_home_err")
+ &drivemounts.partition + &drivemounts.partition
+ ") Must at least be 10GBs"), + &gettext("fstab_small_home_size")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err9"); partition_method_manual_error_label.set_widget_name("err9");
@ -650,9 +649,9 @@ fn partition_err_check(
if partition_fs == "vfat" || partition_fs == "ntfs" || partition_fs == "swap" || partition_fs == "exfat" { if partition_fs == "vfat" || partition_fs == "ntfs" || partition_fs == "swap" || partition_fs == "exfat" {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Bad Filesystem: The partition mounted to /home (/dev/".to_owned() &(gettext("fstab_badfs")
+ &drivemounts.partition + &drivemounts.partition
+ ") Has an Invalid Filesystem"), + &gettext("fstab_badfs_home")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err10"); partition_method_manual_error_label.set_widget_name("err10");
@ -667,9 +666,9 @@ fn partition_err_check(
if partition_fs != "swap" { if partition_fs != "swap" {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Bad Filesystem: ".to_owned() &(gettext("fstab_badfs")
+ &drivemounts.partition + &drivemounts.partition
+ " Is not a swap partition"), + &gettext("fstab_badfs_swap")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err11"); partition_method_manual_error_label.set_widget_name("err11");
@ -687,9 +686,9 @@ fn partition_err_check(
{ {
if !partition_method_manual_error_label.is_visible() { if !partition_method_manual_error_label.is_visible() {
partition_method_manual_error_label.set_label( partition_method_manual_error_label.set_label(
&("Bad Mountpoint: ".to_owned() &(gettext("fstab_bad_mountpoint")
+ &drivemounts.mountpoint + &drivemounts.mountpoint
+ " Is not a valid mountpoint"), + &gettext("fstab_bad_mountpoint_msg")),
); );
partition_method_manual_error_label.set_visible(true); partition_method_manual_error_label.set_visible(true);
partition_method_manual_error_label.set_widget_name("err12"); partition_method_manual_error_label.set_widget_name("err12");