Skip to content

Commit

Permalink
Merge branch 'main' into ryonakano/locale-main-country
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Oct 15, 2024
2 parents b7c4fdd + 67b268a commit 3feaa61
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 29 deletions.
6 changes: 3 additions & 3 deletions po/en_GB.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-08 16:51+0000\n"
"PO-Revision-Date: 2024-09-29 02:16+0000\n"
"PO-Revision-Date: 2024-10-13 05:38+0000\n"
"Last-Translator: David Hewitt <[email protected]>\n"
"Language-Team: English (United Kingdom) <https://l10n.elementary.io/projects/"
"installer/installer/en_GB/>\n"
Expand All @@ -21,7 +21,7 @@ msgstr "Connect to a Power Source"

#: src/Application.vala:60
msgid "Installation will not succeed if this device loses power."
msgstr ""
msgstr "Installation will not succeed if this device loses power."

#: src/Application.vala:73
#, c-format
Expand Down Expand Up @@ -565,7 +565,7 @@ msgstr "Default (ext4)"

#: src/Widgets/PartitionMenu.vala:261
msgid "Custom value must begin with /"
msgstr ""
msgstr "Custom value must begin with /"

#~ msgid ""
#~ "Your device is running on battery power. It's recommended to be plugged "
Expand Down
4 changes: 2 additions & 2 deletions po/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-08 16:51+0000\n"
"PO-Revision-Date: 2024-10-09 18:16+0000\n"
"PO-Revision-Date: 2024-10-14 17:11+0000\n"
"Last-Translator: Italo Felipe Capasso Ballesteros <[email protected]>\n"
"Language-Team: Spanish <https://l10n.elementary.io/projects/installer/"
"installer/es/>\n"
Expand Down Expand Up @@ -452,7 +452,7 @@ msgid ""
"Create, resize, or otherwise manage partitions manually. This method may "
"lead to data loss."
msgstr ""
"Cree, redimensione o gestione manualmente las particiones. Este método puede "
"Cree, redimensione o gestione particiones manualmente. Este método puede "
"provocar la pérdida de datos."

#: src/Views/TryInstallView.vala:107
Expand Down
4 changes: 2 additions & 2 deletions po/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-08 16:51+0000\n"
"PO-Revision-Date: 2024-10-09 18:16+0000\n"
"PO-Revision-Date: 2024-10-12 12:00+0000\n"
"Last-Translator: Ryo Nakano <[email protected]>\n"
"Language-Team: Japanese <https://l10n.elementary.io/projects/installer/"
"installer/ja/>\n"
Expand Down Expand Up @@ -334,7 +334,7 @@ msgstr "言語を選択"

#: src/Views/LanguageView.vala:295 src/Views/LanguageView.vala:342
msgid "Currently active language"
msgstr "現在使用可能な言語"
msgstr "現在の選択言語"

#: src/Views/PartitioningView.vala:51
msgid "Select Partitions"
Expand Down
8 changes: 4 additions & 4 deletions po/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-08 16:51+0000\n"
"PO-Revision-Date: 2024-09-15 16:16+0000\n"
"Last-Translator: José Rafael <jrafaeldesantana@gmail.com>\n"
"PO-Revision-Date: 2024-10-15 06:30+0000\n"
"Last-Translator: Gustavo Silva <g.costasalles@gmail.com>\n"
"Language-Team: Portuguese (Brazil) <https://l10n.elementary.io/projects/"
"installer/installer/pt_BR/>\n"
"Language: pt_BR\n"
Expand All @@ -21,7 +21,7 @@ msgstr "Conecte a uma fonte de energia"

#: src/Application.vala:60
msgid "Installation will not succeed if this device loses power."
msgstr ""
msgstr "A instalação irá falhar se o aparelho perder energia."

#: src/Application.vala:73
#, c-format
Expand Down Expand Up @@ -571,7 +571,7 @@ msgstr "Padrão (ext4)"

#: src/Widgets/PartitionMenu.vala:261
msgid "Custom value must begin with /"
msgstr ""
msgstr "Valor customizado deve começar com /"

#~ msgid ""
#~ "Your device is running on battery power. It's recommended to be plugged "
Expand Down
4 changes: 2 additions & 2 deletions po/zh_TW.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-08 16:51+0000\n"
"PO-Revision-Date: 2024-10-07 08:07+0000\n"
"PO-Revision-Date: 2024-10-14 16:04+0000\n"
"Last-Translator: Kisaragi Hiu <[email protected]>\n"
"Language-Team: Chinese (Traditional) <https://l10n.elementary.io/projects/"
"installer/installer/zh_Hant/>\n"
Expand All @@ -21,7 +21,7 @@ msgstr "請連接電源"

#: src/Application.vala:60
msgid "Installation will not succeed if this device loses power."
msgstr ""
msgstr "裝置若是沒電會無法完成安裝。"

#: src/Application.vala:73
#, c-format
Expand Down
10 changes: 5 additions & 5 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public class Installer.App : Gtk.Application {
}

construct {
GLib.Intl.setlocale (LocaleCategory.ALL, "");
GLib.Intl.bindtextdomain (application_id, Build.LOCALEDIR);
GLib.Intl.bind_textdomain_codeset (application_id, "UTF-8");
GLib.Intl.textdomain (application_id);

add_main_option_entries (INSTALLER_OPTIONS);
}

Expand Down Expand Up @@ -84,5 +79,10 @@ public class Installer.App : Gtk.Application {
}

public static int main (string[] args) {
GLib.Intl.setlocale (LocaleCategory.ALL, "");
GLib.Intl.bindtextdomain (Build.GETTEXT_PACKAGE, Build.LOCALEDIR);
GLib.Intl.bind_textdomain_codeset (Build.GETTEXT_PACKAGE, "UTF-8");
GLib.Intl.textdomain (Build.GETTEXT_PACKAGE);

return new Installer.App ().run (args);
}
2 changes: 1 addition & 1 deletion src/Views/CheckView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class Installer.CheckView : AbstractInstallerView {
private Gtk.Box message_box;
public bool has_messages {
get {
return message_box.get_first_child != null;
return message_box.get_first_child () != null;
}
}

Expand Down
43 changes: 33 additions & 10 deletions src/Widgets/DiskBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public class Installer.DiskBar: Gtk.Box {
public Gee.ArrayList<PartitionBlock> partitions { get; construct; }
public uint64 size { get; construct; }

private Gtk.ConstraintGuide guide;

public PartitionContainer (uint64 size, Gee.ArrayList<PartitionBlock> partitions) {
Object (
partitions: partitions,
Expand All @@ -81,6 +83,28 @@ public class Installer.DiskBar: Gtk.Box {
}

construct {
guide = new Gtk.ConstraintGuide () {
max_width = 300,
min_width = 300,
nat_width = 600
};

var layout_manager = ((Gtk.ConstraintLayout) get_layout_manager ());
layout_manager.add_guide (guide);

layout_manager.add_constraint (
new Gtk.Constraint (
guide,
HEIGHT,
EQ,
this,
HEIGHT,
1.0,
0.0,
Gtk.ConstraintStrength.REQUIRED
)
);

uint64 used = 0;
var disk_sectors = size / 512;
foreach (var partition in partitions) {
Expand All @@ -100,17 +124,16 @@ public class Installer.DiskBar: Gtk.Box {
var unused_bar = new Block ();
unused_bar.add_css_class ("unused");

append_partition (unused_bar, unused / size);
append_partition (unused_bar, (double) unused / size);
}

var layout_manager = ((Gtk.ConstraintLayout) get_layout_manager ());
// Position last child at end
layout_manager.add_constraint (
new Gtk.Constraint (
get_last_child (),
null,
END,
EQ,
this,
get_last_child (),
END,
1.0,
0.0,
Expand All @@ -136,7 +159,7 @@ public class Installer.DiskBar: Gtk.Box {
widget,
HEIGHT,
EQ,
this,
guide,
HEIGHT,
1.0,
0.0,
Expand All @@ -150,7 +173,7 @@ public class Installer.DiskBar: Gtk.Box {
widget,
WIDTH,
EQ,
this,
guide,
WIDTH,
percentage,
0,
Expand All @@ -163,10 +186,10 @@ public class Installer.DiskBar: Gtk.Box {
// Position at start
layout_manager.add_constraint (
new Gtk.Constraint (
widget,
null,
START,
EQ,
this,
widget,
START,
1.0,
0.0,
Expand All @@ -182,8 +205,8 @@ public class Installer.DiskBar: Gtk.Box {
EQ,
previous_child,
END,
1.0,
0.0,
1,
0,
Gtk.ConstraintStrength.REQUIRED
)
);
Expand Down

0 comments on commit 3feaa61

Please sign in to comment.