summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2011-03-30 14:59:30 -0400
committerChris Lumens <clumens@redhat.com>2011-03-30 14:59:30 -0400
commit7764c732aa108888d7682b41bf45b00feb5cb737 (patch)
tree2dacf6b8ab84ae2377498eb740e75e0343f1b598
parent66895d2f7c30bb7e0bd704ca47ea43136d34c29b (diff)
downloadanaconda-7764c732aa108888d7682b41bf45b00feb5cb737.tar.gz
anaconda-7764c732aa108888d7682b41bf45b00feb5cb737.tar.xz
anaconda-7764c732aa108888d7682b41bf45b00feb5cb737.zip
Improve the translatability of strings with more than one format specifier.
-rw-r--r--pyanaconda/installinterfacebase.py12
-rw-r--r--pyanaconda/iw/filter_gui.py2
-rw-r--r--pyanaconda/iw/partition_gui.py4
-rw-r--r--pyanaconda/iw/upgrade_swap_gui.py7
-rw-r--r--pyanaconda/platform.py4
-rw-r--r--pyanaconda/rescue.py3
-rw-r--r--pyanaconda/storage/__init__.py23
-rw-r--r--pyanaconda/storage/devices.py6
-rw-r--r--pyanaconda/text.py2
-rw-r--r--pyanaconda/textw/constants_text.py2
-rw-r--r--pyanaconda/textw/upgrade_text.py7
11 files changed, 36 insertions, 36 deletions
diff --git a/pyanaconda/installinterfacebase.py b/pyanaconda/installinterfacebase.py
index 4f55103a2..898c863ef 100644
--- a/pyanaconda/installinterfacebase.py
+++ b/pyanaconda/installinterfacebase.py
@@ -69,13 +69,11 @@ class InstallInterfaceBase(object):
self._warnedUnusedRaidMembers.extend(unusedRaidMembers)
unusedRaidMembers.sort()
self.messageWindow(_("Warning"),
- P_("Disk %s contains BIOS RAID metadata, but is not part of "
- "any recognized BIOS RAID sets. Ignoring disk %s.",
- "Disks %s contain BIOS RAID metadata, but are not part of "
- "any recognized BIOS RAID sets. Ignoring disks %s.",
- len(unusedRaidMembers)) %
- (", ".join(unusedRaidMembers),
- ", ".join(unusedRaidMembers)),
+ P_("Disk %(unusedRaidMems)s contains BIOS RAID metadata, but is not part of "
+ "any recognized BIOS RAID sets. Ignoring disk %(unusedRaidMems)s.",
+ "Disks %(unusedRaidMems)s contain BIOS RAID metadata, but are not part of "
+ "any recognized BIOS RAID sets. Ignoring disks %(unusedRaidMems)s.",
+ len(unusedRaidMembers)) % {"unusedRaidMems": ", ".join(unusedRaidMembers)},
custom_icon="warning")
def resetInitializeDiskQuestion(self):
diff --git a/pyanaconda/iw/filter_gui.py b/pyanaconda/iw/filter_gui.py
index a0d99a26a..69098c3e6 100644
--- a/pyanaconda/iw/filter_gui.py
+++ b/pyanaconda/iw/filter_gui.py
@@ -148,7 +148,7 @@ class Callbacks(object):
global selectedDevices, totalDevices
global selectedSize, totalSize
- self.sizeLabel.set_markup(_("Selected devices: %s (%s MB) out of %s (%s MB).") % (selectedDevices, selectedSize, totalDevices, totalSize))
+ self.sizeLabel.set_markup(_("Selected devices: %(selectedDevices)s (%(selectedSize)s MB) out of %(totalDevices)s (%(totalSize)s MB).") % {"selectedDevices": selectedDevices, "selectedSize": selectedSize, "totalDevices": totalDevices, "totalSize": totalSize})
def visible(self, model, iter, view):
# Most basic visibility function - does the model say this row
diff --git a/pyanaconda/iw/partition_gui.py b/pyanaconda/iw/partition_gui.py
index 2a2ce97b6..6d539fb62 100644
--- a/pyanaconda/iw/partition_gui.py
+++ b/pyanaconda/iw/partition_gui.py
@@ -447,7 +447,7 @@ class LVMStripeGraph(StripeGraph):
def _createStripe(self, vg):
# Create the stripe
- vgtext = _("LVM Volume Group %s (%-0.f MB)") % (vg.name, vg.size)
+ vgtext = _("LVM Volume Group %(vgName)s (%(vgSize)-0.f MB)") % {"vgName", vg.name, "vgSize": vg.size}
stripe = Stripe(self.getCanvas(), vgtext, self.dcCB, obj = vg)
# Create the slices.
@@ -513,7 +513,7 @@ class MDRaidArrayStripeGraph(StripeGraph):
self.setDisplayed(md)
def _createStripe(self, md):
- mdtext = _("MD RAID ARRAY %s (%-0.f MB)") % (md.path, md.size)
+ mdtext = _("MD RAID ARRAY %(mdPath)s (%(mdSize)-0.f MB)") % {"mdPath": md.path, "mdSize": md.size}
stripe = Stripe(self.getCanvas(), mdtext, self.dcCB, obj = md)
# Since we can't really create subslices with md devices we will only
diff --git a/pyanaconda/iw/upgrade_swap_gui.py b/pyanaconda/iw/upgrade_swap_gui.py
index ddb873579..a998154dc 100644
--- a/pyanaconda/iw/upgrade_swap_gui.py
+++ b/pyanaconda/iw/upgrade_swap_gui.py
@@ -89,10 +89,11 @@ class UpgradeSwapWindow (InstallWindow):
box = gtk.VBox (False, 5)
box.set_border_width (5)
- label = gtk.Label(_("You currently have %dMB of swap configured, which "
- "is less than the recommended miminum of %sMB. You "
+ label = gtk.Label(_("You currently have %(swapAmount)dMB of swap configured, which "
+ "is less than the recommended miminum of %(swapSuggestion)sMB. You "
"may optionally create more swap space on one of "
- "your file systems now.") % (iutil.swapAmount()/1024, iutil.swapSuggestion()[0]/1024))
+ "your file systems now.") % {"swapAmount": iutil.swapAmount()/1024,
+ "swapSuggestion": iutil.swapSuggestion()[0]/1024})
label.set_alignment (0.5, 0.0)
label.set_line_wrap (True)
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 3942887b6..9e636df2a 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -258,8 +258,8 @@ class EFI(Platform):
labelType = self.diskLabelType(partedDisk.device.type)
# Allow using gpt with x86, but not msdos with EFI
if partedDisk.type != labelType and partedDisk.type != "gpt":
- errors.append(_("%s must have a %s disk label.")
- % (p.disk.name, labelType.upper()))
+ errors.append(_("%(disk)s must have a %(labelType)s disk label.")
+ % {"disk": p.disk.name, "labelType": labelType.upper()})
return errors
diff --git a/pyanaconda/rescue.py b/pyanaconda/rescue.py
index f6e55dc30..245a5976c 100644
--- a/pyanaconda/rescue.py
+++ b/pyanaconda/rescue.py
@@ -455,8 +455,7 @@ def runRescue(anaconda):
ButtonChoiceWindow(screen, _("Rescue"),
_("An error occurred trying to mount some or all of your "
"system. Some of it may be mounted under %s.\n\n"
- "Press <return> to get a shell. %s")
- % (anaconda.rootPath, msg),
+ "Press <return> to get a shell.") % anaconda.rootPath + msg,
[_("OK")] )
else:
if anaconda.ksdata and \
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 6c8b47d7c..472627c38 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -1131,15 +1131,15 @@ class Storage(object):
for (mount, device) in filesystems.items():
problem = filesystems[mount].checkSize()
if problem < 0:
- errors.append(_("Your %s partition is too small for %s formatting "
- "(allowable size is %d MB to %d MB)")
- % (mount, problem, device.format.name,
- device.minSize, device.maxSize))
+ errors.append(_("Your %(mount)s partition is too small for %(format)s formatting "
+ "(allowable size is %(minSize)d MB to %(maxSize)d MB)")
+ % {"mount": mount, "format": device.format.name,
+ "minSize": device.minSize, "maxSize": device.maxSize})
elif problem > 0:
- errors.append(_("Your %s partition is too large for %s formatting "
- "(allowable size is %d MB to %d MB)")
- % (mount, problem, device.format.name,
- device.minSize, device.maxSize))
+ errors.append(_("Your %(mount)s partition is too large for %(format)s formatting "
+ "(allowable size is %(minSize)d MB to %(maxSize)d MB)")
+ % {"mount":mount, "format": device.format.name,
+ "minSize": device.minSize, "maxSize": device.maxSize})
usb_disks = []
firewire_disks = []
@@ -1180,9 +1180,10 @@ class Storage(object):
if installed < required:
errors.append(_("You have not specified a swap partition. "
- "%s MB of memory is required to continue installation "
- "without a swap partition, but you only have %s MB.")
- % (int(required.convertTo(spec="MB")), int(installed.convertTo(spec="MB"))))
+ "%(requiredMem)s MB of memory is required to continue installation "
+ "without a swap partition, but you only have %(installedMem)s MB.")
+ % {"requiredMem": int(required.convertTo(spec="MB")),
+ "installedMem": int(installed.convertTo(spec="MB"))})
else:
warnings.append(_("You have not specified a swap partition. "
"Although not strictly required in all cases, "
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 97606f876..36145a322 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -2637,10 +2637,10 @@ class MDRaidArrayDevice(StorageDevice):
# For new arrays check if we have enough members
if (not exists and parents and
len(parents) < mdraid.get_raid_min_members(self.level)):
- raise ValueError, P_("A RAID%d set requires at least %d member",
- "A RAID%d set requires at least %d members",
+ raise ValueError, P_("A RAID%(raidLevel)d set requires at least %(minMembers)d member",
+ "A RAID%(raidLevel)d set requires at least %(minMembers)d members",
mdraid.get_raid_min_members(self.level)) % \
- (self.level, mdraid.get_raid_min_members(self.level))
+ {"raidLevel": self.level, "minMembers": mdraid.get_raid_min_members(self.level)}
self.uuid = uuid
self._totalDevices = numeric_type(totalDevices)
diff --git a/pyanaconda/text.py b/pyanaconda/text.py
index a5dd1a57c..89c858d65 100644
--- a/pyanaconda/text.py
+++ b/pyanaconda/text.py
@@ -260,7 +260,7 @@ class InstallInterface(InstallInterfaceBase):
def reinitializeWindow(self, title, path, size, description):
grid = GridForm(self.screen, title, 1, 3)
- text = TEXT_REINITIALIZE % (description, size, path)
+ text = TEXT_REINITIALIZE % {"description": description, "size": size, "devicePath": path}
grid.add(TextboxReflowed(70, text), 0, 0)
all_devices_cb = Checkbox(TEXT_REINITIALIZE_ALL, isOn=False)
diff --git a/pyanaconda/textw/constants_text.py b/pyanaconda/textw/constants_text.py
index d11b6844d..2563ffae8 100644
--- a/pyanaconda/textw/constants_text.py
+++ b/pyanaconda/textw/constants_text.py
@@ -74,7 +74,7 @@ TEXT_F12_CHECK = "F12"
TEXT_REINITIALIZE = _(
"""This storage device may contain data:
-%s, %s MB, %s
+%(description)s, %(size)s MB, %(devicePath)s
We could not detect partitions or filesystems on this device. This could be \
because the device is blank, unpartitioned, or virtual. If not, there may be \
diff --git a/pyanaconda/textw/upgrade_text.py b/pyanaconda/textw/upgrade_text.py
index 4b3152de1..75f5f4592 100644
--- a/pyanaconda/textw/upgrade_text.py
+++ b/pyanaconda/textw/upgrade_text.py
@@ -109,10 +109,11 @@ class UpgradeSwapWindow:
ramDetected = iutil.memInstalled()/1024
- text = _("You currently have %dMB of swap configured, which "
- "is less than the recommended miminum of %sMB. You "
+ text = _("You currently have %(swapAmount)dMB of swap configured, which "
+ "is less than the recommended miminum of %(swapSuggestion)sMB. You "
"may optionally create more swap space on one of "
- "your file systems now.") % (iutil.swapAmount()/1024, iutil.swapSuggestion()[0]/1024)
+ "your file systems now.") % {"swapAmount": iutil.swapAmount()/1024,
+ "swapSuggestion": iutil.swapSuggestion()[0]/1024}
tb = TextboxReflowed(60, text)
amount = Entry(10, scroll = 0)