Skip to content

Commit

Permalink
translate welcome message
Browse files Browse the repository at this point in the history
  • Loading branch information
jardon committed Sep 30, 2024
1 parent 887d82d commit 2e01075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions vanilla_first_setup/defaults/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class VanillaDefaultWelcome(Adw.Bin):
btn_next = Gtk.Template.Child()
status_page = Gtk.Template.Child()
title_label = Gtk.Template.Child()
welcome_message = Gtk.Template.Child()

def validate_advanced(self):
recipeLoader = RecipeLoader()
Expand Down Expand Up @@ -71,9 +72,11 @@ def change_langs():
for locale in all_locale:
translator = translation('vanilla-first-setup', localedir='/usr/share/locale', languages=[locale], fallback=True)
_ = translator.gettext
breakpoint()
GLib.idle_add(self.title_label.set_text, _("Welcome!"))
GLib.idle_add(self.btn_next.set_label, _("Next"))
GLib.idle_add(self.btn_advanced.set_label, _("Advanced"))
GLib.idle_add(self.welcome_message.set_label, _("Advanced"))
time.sleep(1.2)

RunAsync(change_langs, None)
Expand Down
4 changes: 2 additions & 2 deletions vanilla_first_setup/gtk/default-welcome.ui
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label">Make your choices, this wizard will take care of everything</property>
<object class="GtkLabel" id="welcome_message">
<property name="label" translatable="yes">Make your choices, this wizard will take care of everything</property>
<property name="justify">2</property>
</object>
</child>
Expand Down

0 comments on commit 2e01075

Please sign in to comment.