[gnome-tweak-tool] Use ngettext in settings revert warning
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Use ngettext in settings revert warning
- Date: Wed, 7 Jan 2015 17:22:15 +0000 (UTC)
commit d2085e45c6a1a51dea17e18c9524af8386f79216
Author: Robert Roth <robert roth off gmail com>
Date: Wed Jan 7 19:21:14 2015 +0200
Use ngettext in settings revert warning
https://bugzilla.gnome.org/show_bug.cgi?id=742491
gtweak/tweaks/tweak_group_windows.py | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_group_windows.py b/gtweak/tweaks/tweak_group_windows.py
index eb94a09..40dc54b 100644
--- a/gtweak/tweaks/tweak_group_windows.py
+++ b/gtweak/tweaks/tweak_group_windows.py
@@ -20,6 +20,7 @@ from gtweak.gshellwrapper import GnomeShellFactory
from gtweak.tweakmodel import TWEAK_GROUP_WINDOWS, Tweak
from gtweak.widgets import ListBoxTweakGroup, GSettingsComboEnumTweak, GSettingsComboTweak,
GSettingsSwitchTweak, Title, GSettingsSwitchTweakValue, build_label_beside_widget
from gtweak.utils import XSettingsOverrides
+import gettext
from gi.repository import Gtk, GLib
@@ -77,9 +78,15 @@ class WindowScalingFactorTweak(Gtk.Box, Tweak):
self._dialog.response(Gtk.ResponseType.NO)
return False
+ self._update_countdown_message()
self._dialog.format_secondary_text(self._second_message % self._countdown)
return True
+ def _update_countdown_message(self):
+ self._second_message = gettext.ngettext(_("Settings will be reverted in %d second"),
+ _("Settings will be reverted in %d seconds"),
+ self._countdown);
+
def _close(self):
if self._source > 0:
GLib.Source.remove(self._source)
@@ -93,7 +100,7 @@ class WindowScalingFactorTweak(Gtk.Box, Tweak):
self._countdown = 20
first_message = _("Do you want to keep these HiDPI settings?")
- self._second_message = _("Settings will be reverted in %d seconds")
+ self._update_countdown_message()
self._dialog = Gtk.MessageDialog(
transient_for=self.main_window,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]