Merge lp:~mpt/software-properties/1377742-markup into lp:software-properties

Proposed by Matthew Paul Thomas
Status: Merged
Merged at revision: 935
Proposed branch: lp:~mpt/software-properties/1377742-markup
Merge into: lp:software-properties
Diff against target: 66 lines (+12/-14)
3 files modified
softwareproperties/gtk/DialogAddSourcesList.py (+1/-1)
softwareproperties/kde/DialogAdd.py (+6/-5)
softwareproperties/kde/SoftwarePropertiesKDE.py (+5/-8)
To merge this branch: bzr merge lp:~mpt/software-properties/1377742-markup
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+261487@code.launchpad.net

Description of the change

Factors out Pango markup from translatable strings, to avoid problems like bug 1377742. Also switches to using <small> for alert secondary text, rather than <b><big> for primary text.

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Nice, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwareproperties/gtk/DialogAddSourcesList.py'
--- softwareproperties/gtk/DialogAddSourcesList.py 2014-09-11 09:06:49 +0000
+++ softwareproperties/gtk/DialogAddSourcesList.py 2015-06-09 11:30:26 +0000
@@ -104,7 +104,7 @@
104 header = _("There are no sources to install software from")104 header = _("There are no sources to install software from")
105 body = _("The file '%s' does not contain any valid "105 body = _("The file '%s' does not contain any valid "
106 "software sources." % self.file)106 "software sources." % self.file)
107 self.label.set_markup("<big><b>%s</b></big>\n\n%s" % (header, body))107 self.label.set_markup("%s\n\n<small>%s</small>" % (header, body))
108108
109 def run(self):109 def run(self):
110 res = self.dialog.run()110 res = self.dialog.run()
111111
=== modified file 'softwareproperties/kde/DialogAdd.py'
--- softwareproperties/kde/DialogAdd.py 2014-12-01 07:04:29 +0000
+++ softwareproperties/kde/DialogAdd.py 2015-06-09 11:30:26 +0000
@@ -52,12 +52,13 @@
52 else:52 else:
53 example = "deb http://ftp.debian.org sarge main"53 example = "deb http://ftp.debian.org sarge main"
54 # L10N: the example is of the format: deb http://ftp.debian.org sarge main54 # L10N: the example is of the format: deb http://ftp.debian.org sarge main
55 head = _('<big><b>Enter the complete APT line of the repository that '55 primary = _('Enter the complete APT line of the repository that '
56 'you want to add as source</b></big>')56 'you want to add.')
57 msg = _("The APT line includes the type, location and components of a "57 secondary = _("Include the type, location and components of the "
58 "repository, for example '%s'.") % ("<i>%s</i>" % example)58 "repository. Example: %s") % example
59 text = "%s<br /><br /><small>%s</small>" % primary, secondary
59 self.label_example_line.setWordWrap(True)60 self.label_example_line.setWordWrap(True)
60 self.label_example_line.setText(head + '<p>' + msg)61 self.label_example_line.setText(text)
6162
62 translate_widget(self)63 translate_widget(self)
6364
6465
=== modified file 'softwareproperties/kde/SoftwarePropertiesKDE.py'
--- softwareproperties/kde/SoftwarePropertiesKDE.py 2014-12-01 07:04:29 +0000
+++ softwareproperties/kde/SoftwarePropertiesKDE.py 2015-06-09 11:30:26 +0000
@@ -702,13 +702,9 @@
702 messageBox.setIcon(QMessageBox.Information)702 messageBox.setIcon(QMessageBox.Information)
703 reloadButton = messageBox.addButton(_("Reload"), QMessageBox.AcceptRole)703 reloadButton = messageBox.addButton(_("Reload"), QMessageBox.AcceptRole)
704 messageBox.addButton(QMessageBox.Close)704 messageBox.addButton(QMessageBox.Close)
705 text = _("<b><big>The information about available software is out-of-date</big></b>\n"705 primary = _("Your local copy of the software catalog is out of date.")
706 "\n"706 secondary = _("A new copy will be downloaded.")
707 "To install software and updates from newly added or changed sources, you "707 text = "%s<br /><br /><small>%s</small>" % primary, secondary
708 "have to reload the information about available software.\n"
709 "\n"
710 "You need a working internet connection to continue.")
711 text = text.replace("\n", "<br />")
712 messageBox.setText(text)708 messageBox.setText(text)
713 messageBox.exec_()709 messageBox.exec_()
714 if (messageBox.clickedButton() == reloadButton):710 if (messageBox.clickedButton() == reloadButton):
@@ -732,7 +728,8 @@
732 res = cdrom.add(progress)728 res = cdrom.add(progress)
733 except SystemError as msg:729 except SystemError as msg:
734 title = _("CD Error")730 title = _("CD Error")
735 text = _("<big><b>Error scanning the CD</b></big>\n\n%s")%msg731 primary = _("Error scanning the CD")
732 text = "%s\n\n<small>%s</small>") % primary, msg
736 #KMessageBox.sorry(self.userinterface, text, title)733 #KMessageBox.sorry(self.userinterface, text, title)
737 QMessageBox.warning(self.userinterface, title, text)734 QMessageBox.warning(self.userinterface, title, text)
738 return735 return

Subscribers

People subscribed via source and target branches

to status/vote changes: