diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-10-01 10:20:30 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-10-01 10:20:30 -1000 |
commit | 576d6d67ded60eac2133f324c20d3484904ea475 (patch) | |
tree | 278161e765bfd939d2fb113aae9e7bf6f1fed06a /iw/lvm_dialog_gui.py | |
parent | 89f97834a415fa9aafa0824e7603fe8091058efb (diff) | |
download | anaconda-576d6d67ded60eac2133f324c20d3484904ea475.tar.gz anaconda-576d6d67ded60eac2133f324c20d3484904ea475.tar.xz anaconda-576d6d67ded60eac2133f324c20d3484904ea475.zip |
Use named parameters for translatable strings with multiple params.
This is a cleanup for the po files. xgettext displays the following
messages for some Python files:
warning: 'msgid' format string with unnamed arguments cannot be properly localized:
The translator cannot reorder the arguments.
Please consider using a format string with named arguments,
and a mapping instead of a tuple for the arguments.
This patch modifies the reported format strings to use named parameters
per the warning message. We were already using these style format
strings in users.py and possibly other files. Basically when there is
more than one parameter in the format string, we should use a hash table
with named parameters.
Diffstat (limited to 'iw/lvm_dialog_gui.py')
-rw-r--r-- | iw/lvm_dialog_gui.py | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py index 292a485fd..b481c40fb 100644 --- a/iw/lvm_dialog_gui.py +++ b/iw/lvm_dialog_gui.py @@ -170,9 +170,11 @@ class VolumeGroupEditor: self.intf.messageWindow(_("Not enough space"), _("The physical extent size cannot be " "changed because the value selected " - "(%10.2f MB) is larger than the smallest " - "physical volume (%10.2f MB) in the " - "volume group.") % (curpe, maxpvsize), + "(%(curpe)10.2f MB) is larger than the " + "smallest physical volume " + "(%(maxpvsize)10.2f MB) in the volume " + "group.") % {'curpe': curpe, + 'maxpvsize': maxpvsize}, custom_icon="error") widget.set_active(lastidx) return 0 @@ -182,12 +184,12 @@ class VolumeGroupEditor: self.intf.messageWindow(_("Not enough space"), _("The physical extent size cannot be " "changed because the value selected " - "(%10.2f MB) is too large compared " - "to the size of the " + "(%(curpe)10.2f MB) is too large " + "compared to the size of the " "smallest physical volume " - "(%10.2f MB) in the " - "volume group.") % (curpe, - maxpvsize), + "(%(maxpvsize)10.2f MB) in the " + "volume group.") + % {'curpe': curpe, 'maxpvsize': maxpvsize}, custom_icon="error") widget.set_active(lastidx) return 0 @@ -676,13 +678,14 @@ class VolumeGroupEditor: if size > maxlv: self.intf.messageWindow(_("Not enough space"), _("The current requested size " - "(%10.2f MB) is larger than the maximum " - "logical volume size (%10.2f MB). " + "(%(size)10.2f MB) is larger than " + "the maximum logical volume size " + "(%(maxlv)10.2f MB). " "To increase this limit you can " "create more Physical Volumes from " "unpartitioned disk space and " "add them to this Volume Group.") - %(size, maxlv), + % {'size': size, 'maxlv': maxlv}, custom_icon="error") continue @@ -696,11 +699,14 @@ class VolumeGroupEditor: except ValueError: self.intf.messageWindow(_("Not enough space"), _("The logical volumes you have " - "configured require %d MB, but the " - "volume group only has %d MB. Please " - "either make the volume group larger " - "or make the logical volume(s) smaller.") - % (size, tempvg.size), + "configured require %(size)d MB," + " but the volume group only has " + "%(tempvgsize)d MB. Please " + "either make the volume group " + "larger or make the logical " + "volume(s) smaller.") + % {'size': size, + 'tempvgsize': tempvg.size}, custom_icon="error") continue |