From 2119473ded9b601a73c36e4bebd9c9ceaff78286 Mon Sep 17 00:00:00 2001 From: Sabri Ünal Date: Tue, 13 Jun 2023 23:09:14 +0300 Subject: [PATCH] App: Mark preferences strings translatable --- src/main.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main.py b/src/main.py index 497a62c..2cd2fba 100644 --- a/src/main.py +++ b/src/main.py @@ -25,6 +25,7 @@ gi.require_version('Adw', '1') from gi.repository import Gtk, Gio, Adw, Gdk from .window import TeleprompterWindow +from gettext import gettext as _ # Create an instance of AdwStyleManager style_manager = Adw.StyleManager.get_default() @@ -72,18 +73,18 @@ class TeleprompterApplication(Adw.Application): pref = Adw.PreferencesWindow() - settingsPage = Adw.PreferencesPage(title="Generals") + settingsPage = Adw.PreferencesPage(title=_("Generals")) settingsPage.set_icon_name("applications-system-symbolic") pref.add(settingsPage) # stylePage = Adw.PreferencesPage(title="Style") # stylePage.set_icon_name("applications-graphics-symbolic") # pref.add(stylePage) - scrollSettingsGroup = Adw.PreferencesGroup(title="Scroll Settings") + scrollSettingsGroup = Adw.PreferencesGroup(title=_("Scroll Settings")) settingsPage.add(scrollSettingsGroup) - scrollSpeedRow = Adw.ActionRow(title="Scroll Speed", subtitle="Measured in words per minute") + scrollSpeedRow = Adw.ActionRow(title=_("Scroll Speed"), subtitle=_("Measured in words per minute")) scrollSettingsGroup.add(scrollSpeedRow) scrollSpeedScale = Gtk.Scale(valign = Gtk.Align.CENTER) @@ -97,7 +98,7 @@ class TeleprompterApplication(Adw.Application): scrollSpeedScale.set_adjustment(speed) - slowScrollSpeedRow = Adw.ActionRow(title="Slow Scroll Speed", subtitle="When pressing the spacebar") + slowScrollSpeedRow = Adw.ActionRow(title=_("Slow Scroll Speed"), subtitle=_("When pressing the spacebar")) # scrollSettingsGroup.add(slowScrollSpeedRow) slowScrollSpeedScale = Gtk.Scale(valign = Gtk.Align.CENTER) @@ -110,28 +111,28 @@ class TeleprompterApplication(Adw.Application): speed2.set_value(TeleprompterWindow.settings.slowSpeed) slowScrollSpeedScale.set_adjustment(speed2) - textGroup = Adw.PreferencesGroup(title="Text") + textGroup = Adw.PreferencesGroup(title=_("Text")) settingsPage.add(textGroup) - highlightColorPickerRow = Adw.ActionRow(title="Highlight color") + highlightColorPickerRow = Adw.ActionRow(title=_("Highlight color")) textGroup.add(highlightColorPickerRow) highlightColorPicker = Gtk.ColorButton(valign = Gtk.Align.CENTER) highlightColorPicker.set_rgba(TeleprompterWindow.settings.highlightColor) highlightColorPickerRow.add_suffix(highlightColorPicker) - boldHighlight = Adw.ActionRow(title="Bold Highlight") + boldHighlight = Adw.ActionRow(title=_("Bold Highlight")) textGroup.add(boldHighlight) boldHighlightSwitch = Gtk.Switch(valign = Gtk.Align.CENTER) boldHighlightSwitch.set_active(TeleprompterWindow.settings.boldHighlight) boldHighlight.add_suffix(boldHighlightSwitch) - fontColorPickerRow = Adw.ActionRow(title="Font color") + fontColorPickerRow = Adw.ActionRow(title=_("Font color")) textGroup.add(fontColorPickerRow) - fontPickerRow = Adw.ActionRow(title="Font") + fontPickerRow = Adw.ActionRow(title=_("Font")) textGroup.add(fontPickerRow) fontPicker = Gtk.FontButton(valign = Gtk.Align.CENTER) -- libgit2 1.0.1