summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-01-06 15:18:04 -0500
committerChris Lumens <clumens@redhat.com>2012-01-09 10:38:29 -0500
commit6c539d27d0c6fd8fd7e9e24495d404d57c76e4ef (patch)
treea5b96c12e348fadf52d3c9827e2b6f86feb21a96
parenta96445e9d3f94868d5b3a2917ca809da136f7623 (diff)
downloadanaconda-6c539d27d0c6fd8fd7e9e24495d404d57c76e4ef.tar.gz
anaconda-6c539d27d0c6fd8fd7e9e24495d404d57c76e4ef.tar.xz
anaconda-6c539d27d0c6fd8fd7e9e24495d404d57c76e4ef.zip
Mark more strings for translation.
-rw-r--r--pyanaconda/ui/gui/__init__.py3
-rw-r--r--pyanaconda/ui/gui/categories/__init__.py4
-rw-r--r--pyanaconda/ui/gui/categories/localization.py4
-rw-r--r--pyanaconda/ui/gui/categories/software.py4
-rw-r--r--pyanaconda/ui/gui/hubs/__init__.py9
-rw-r--r--pyanaconda/ui/gui/spokes/language.py8
-rw-r--r--pyanaconda/ui/gui/spokes/software.py8
-rw-r--r--pyanaconda/ui/gui/spokes/source.py14
-rw-r--r--pyanaconda/ui/gui/spokes/storage.py9
-rw-r--r--widgets/src/BaseWindow.c4
-rw-r--r--widgets/src/DiskOverview.c8
-rw-r--r--widgets/src/SpokeSelector.c4
-rw-r--r--widgets/src/intl.h1
13 files changed, 52 insertions, 28 deletions
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index c0ad53198..ca08edc8f 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -84,7 +84,8 @@ class GraphicalUserInterface(UserInterface):
self._actions[0].setup()
self._actions[0].window.set_beta(not isFinal)
- self._actions[0].window.set_property("distribution", _("%s %s INSTALLATION") % (productName, productVersion))
+ self._actions[0].window.set_property("distribution", _("%(productName)s %(productVersion)s INSTALLATION") % \
+ {"productName": productName, "productVersion": productVersion})
self._actions[0].window.show_all()
Gtk.main()
diff --git a/pyanaconda/ui/gui/categories/__init__.py b/pyanaconda/ui/gui/categories/__init__.py
index 10b6d251f..31739d7f2 100644
--- a/pyanaconda/ui/gui/categories/__init__.py
+++ b/pyanaconda/ui/gui/categories/__init__.py
@@ -19,6 +19,8 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+N_ = lambda x: x
+
from pyanaconda.ui.gui import collect
__all__ = ["SpokeCategory", "collect_categories"]
@@ -38,7 +40,7 @@ class SpokeCategory(object):
the grid.
"""
displayOnHub = None
- title = "DEFAULT TITLE"
+ title = N_("DEFAULT TITLE")
def grid(self, selectors):
"""Construct a Gtk.Grid consisting of two columns from the provided
diff --git a/pyanaconda/ui/gui/categories/localization.py b/pyanaconda/ui/gui/categories/localization.py
index 787f4d29f..577efdc6b 100644
--- a/pyanaconda/ui/gui/categories/localization.py
+++ b/pyanaconda/ui/gui/categories/localization.py
@@ -19,6 +19,8 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+N_ = lambda x: x
+
from pyanaconda.ui.gui.categories import SpokeCategory
from pyanaconda.ui.gui.hubs.summary import SummaryHub
@@ -26,4 +28,4 @@ __all__ = ["LocalizationCategory"]
class LocalizationCategory(SpokeCategory):
displayOnHub = SummaryHub
- title = "LOCALIZATION"
+ title = N_("LOCALIZATION")
diff --git a/pyanaconda/ui/gui/categories/software.py b/pyanaconda/ui/gui/categories/software.py
index b0e2c5bf3..0b84499c1 100644
--- a/pyanaconda/ui/gui/categories/software.py
+++ b/pyanaconda/ui/gui/categories/software.py
@@ -19,6 +19,8 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+N_ = lambda x: x
+
from pyanaconda.ui.gui.categories import SpokeCategory
from pyanaconda.ui.gui.hubs.summary import SummaryHub
@@ -26,4 +28,4 @@ __all__ = ["SoftwareCategory"]
class SoftwareCategory(SpokeCategory):
displayOnHub = SummaryHub
- title = "SOFTWARE"
+ title = N_("SOFTWARE")
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index 9a2e3acc1..bb559d537 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -19,6 +19,9 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+import gettext
+_ = lambda x: gettext.ldgettext("anaconda", x)
+
from pyanaconda.ui.gui import UIObject
from pyanaconda.ui.gui.categories import collect_categories
from pyanaconda.ui.gui.spokes import StandaloneSpoke, collect_spokes
@@ -116,7 +119,7 @@ class Hub(UIObject):
# And then create its associated selector, and set some default
# values that affect its display on the hub.
- selector = AnacondaWidgets.SpokeSelector(spoke.title, spoke.icon)
+ selector = AnacondaWidgets.SpokeSelector(_(spoke.title), spoke.icon)
selector.set_property("status", spoke.status)
selector.set_incomplete(not spoke.completed)
self._handleCompleteness(spoke)
@@ -133,7 +136,7 @@ class Hub(UIObject):
if not selectors:
continue
- label = Gtk.Label("<span font-desc=\"Sans 14\">%s</span>" % obj.title)
+ label = Gtk.Label("<span font-desc=\"Sans 14\">%s</span>" % _(obj.title))
label.set_use_markup(True)
label.set_halign(Gtk.Align.START)
label.set_margin_bottom(12)
@@ -162,7 +165,7 @@ class Hub(UIObject):
if len(self._incompleteSpokes) == 0:
self.window.clear_info()
else:
- self.window.set_info(Gtk.MessageType.WARNING, "Please complete items marked with this icon first.")
+ self.window.set_info(Gtk.MessageType.WARNING, _("Please complete items marked with this icon first."))
def setup(self):
UIObject.setup(self)
diff --git a/pyanaconda/ui/gui/spokes/language.py b/pyanaconda/ui/gui/spokes/language.py
index 3a9237498..0b9d0a22d 100644
--- a/pyanaconda/ui/gui/spokes/language.py
+++ b/pyanaconda/ui/gui/spokes/language.py
@@ -19,6 +19,10 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+import gettext
+_ = lambda x: gettext.ldgettext("anaconda", x)
+N_ = lambda x: x
+
from gi.repository import Gtk
from pyanaconda.ui.gui import UIObject
@@ -52,7 +56,7 @@ class LanguageSpoke(NormalSpoke):
category = LocalizationCategory
icon = "accessories-character-map"
- title = "LANGUAGE"
+ title = N_("LANGUAGE")
def apply(self):
pass
@@ -65,7 +69,7 @@ class LanguageSpoke(NormalSpoke):
@property
def status(self):
- return "Something selected"
+ return _("Something selected")
def populate(self):
NormalSpoke.populate(self)
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index ed9a5dc43..3cb71a437 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -19,6 +19,10 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+import gettext
+_ = lambda x: gettext.ldgettext("anaconda", x)
+N_ = lambda x: x
+
from gi.repository import Gtk
from pyanaconda.ui.gui.spokes import NormalSpoke
@@ -34,7 +38,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
category = SoftwareCategory
icon = "package-x-generic-symbolic"
- title = "SOFTWARE SELECTION"
+ title = N_("SOFTWARE SELECTION")
def apply(self):
pass
@@ -47,7 +51,7 @@ class SoftwareSelectionSpoke(NormalSpoke):
def status(self):
row = self._get_selected_desktop()
if not row:
- return "Nothing selected"
+ return _("Nothing selected")
return row[2]
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index d5cefe5cd..a5a8d8e2a 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -19,6 +19,10 @@
# Red Hat Author(s): Chris Lumens <clumens@redhat.com>
#
+import gettext
+_ = lambda x: gettext.ldgettext("anaconda", x)
+N_ = lambda x: x
+
import os.path
from gi.repository import Gtk, AnacondaWidgets
@@ -112,7 +116,7 @@ class SourceSpoke(NormalSpoke):
category = SoftwareCategory
icon = "media-optical-symbolic"
- title = "INSTALL SOURCE"
+ title = N_("INSTALL SOURCE")
def __init__(self, *args, **kwargs):
NormalSpoke.__init__(self, *args, **kwargs)
@@ -167,7 +171,7 @@ class SourceSpoke(NormalSpoke):
@property
def completed(self):
- return self.status and self.status != "Nothing selected"
+ return self.status and self.status != _("Nothing selected")
@property
def status(self):
@@ -177,13 +181,13 @@ class SourceSpoke(NormalSpoke):
else:
return self.data.method.url
elif self.data.method.method == "nfs":
- return "NFS server %s" % self.data.method.server
+ return _("NFS server %s") % self.data.method.server
elif self.data.method.method == "cdrom":
- return "CD/DVD drive"
+ return _("CD/DVD drive")
elif self.data.method.method == "harddrive":
return os.path.basename(self._currentIsoFile)
else:
- return "Nothing selected"
+ return _("Nothing selected")
def _grabObjects(self):
self._autodetectButton = self.builder.get_object("autodetectRadioButton")
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index c961a31be..e403a2ec0 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -58,6 +58,7 @@ from pyanaconda.product import productName
import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
+N_ = lambda x: x
P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
__all__ = ["StorageSpoke"]
@@ -358,7 +359,7 @@ class StorageSpoke(NormalSpoke):
# other candidates: computer-symbolic, folder-symbolic
icon = "drive-harddisk-symbolic"
- title = "STORAGE CONFIGURATION"
+ title = N_("STORAGE CONFIGURATION")
def apply(self):
pass
@@ -370,12 +371,12 @@ class StorageSpoke(NormalSpoke):
@property
def status(self):
""" A short string describing the current status of storage setup. """
- msg = "no disks selected"
+ msg = _("No disks selected")
if self.data.ignoredisk.onlyuse:
- msg = "%d disks selected" % len(self.data.ignoredisk.onlyuse)
+ msg = _("%d disks selected") % len(self.data.ignoredisk.onlyuse)
if self.data.autopart.autopart:
- msg = "Automatic partitioning selected"
+ msg = _("Automatic partitioning selected")
# if we had a storage instance we could check for a defined root
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 63fef9ce8..44c60ef75 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -73,8 +73,8 @@ enum {
PROP_WINDOW_NAME
};
-#define DEFAULT_DISTRIBUTION "DISTRIBUTION INSTALLATION"
-#define DEFAULT_WINDOW_NAME "SPOKE NAME"
+#define DEFAULT_DISTRIBUTION N_("DISTRIBUTION INSTALLATION")
+#define DEFAULT_WINDOW_NAME N_("SPOKE NAME")
struct _AnacondaBaseWindowPrivate {
gboolean is_beta, info_shown;
diff --git a/widgets/src/DiskOverview.c b/widgets/src/DiskOverview.c
index 474bea4d0..6ebdb9f36 100644
--- a/widgets/src/DiskOverview.c
+++ b/widgets/src/DiskOverview.c
@@ -46,9 +46,9 @@ enum {
};
/* Defaults for each property. */
-#define DEFAULT_DESCRIPTION "New Device"
-#define DEFAULT_KIND "drive-harddisk"
-#define DEFAULT_CAPACITY "0 MB"
+#define DEFAULT_DESCRIPTION N_("New Device")
+#define DEFAULT_KIND N_("drive-harddisk")
+#define DEFAULT_CAPACITY N_("0 MB")
#define DEFAULT_OS ""
#define DEFAULT_POPUP_INFO ""
@@ -189,7 +189,7 @@ static void anaconda_disk_overview_init(AnacondaDiskOverview *widget) {
/* Create the capacity label. */
widget->priv->capacity_label = gtk_label_new(NULL);
- markup = g_markup_printf_escaped("<span size='large'>%s</span>", DEFAULT_CAPACITY);
+ markup = g_markup_printf_escaped("<span size='large'>%s</span>", _(DEFAULT_CAPACITY));
gtk_label_set_markup(GTK_LABEL(widget->priv->capacity_label), markup);
g_free(markup);
diff --git a/widgets/src/SpokeSelector.c b/widgets/src/SpokeSelector.c
index 904a15f32..92f7fa761 100644
--- a/widgets/src/SpokeSelector.c
+++ b/widgets/src/SpokeSelector.c
@@ -50,8 +50,8 @@ enum {
};
#define DEFAULT_ICON "gtk-missing-image"
-#define DEFAULT_STATUS "None"
-#define DEFAULT_TITLE "New Selector"
+#define DEFAULT_STATUS N_("None")
+#define DEFAULT_TITLE N_("New Selector")
struct _AnacondaSpokeSelectorPrivate {
gboolean is_incomplete;
diff --git a/widgets/src/intl.h b/widgets/src/intl.h
index 30bca59dc..b39ee60e5 100644
--- a/widgets/src/intl.h
+++ b/widgets/src/intl.h
@@ -24,6 +24,7 @@
#include "gettext.h"
#define _(x) gettext(x)
+#define N_(String) String
#ifdef ENABLE_NLS
#define P_(String) g_dgettext(GETTEXT_PACKAGE "-properties",String)