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
1=== modified file 'softwareproperties/gtk/DialogAddSourcesList.py'
2--- softwareproperties/gtk/DialogAddSourcesList.py 2014-09-11 09:06:49 +0000
3+++ softwareproperties/gtk/DialogAddSourcesList.py 2015-06-09 11:30:26 +0000
4@@ -104,7 +104,7 @@
5 header = _("There are no sources to install software from")
6 body = _("The file '%s' does not contain any valid "
7 "software sources." % self.file)
8- self.label.set_markup("<big><b>%s</b></big>\n\n%s" % (header, body))
9+ self.label.set_markup("%s\n\n<small>%s</small>" % (header, body))
10
11 def run(self):
12 res = self.dialog.run()
13
14=== modified file 'softwareproperties/kde/DialogAdd.py'
15--- softwareproperties/kde/DialogAdd.py 2014-12-01 07:04:29 +0000
16+++ softwareproperties/kde/DialogAdd.py 2015-06-09 11:30:26 +0000
17@@ -52,12 +52,13 @@
18 else:
19 example = "deb http://ftp.debian.org sarge main"
20 # L10N: the example is of the format: deb http://ftp.debian.org sarge main
21- head = _('<big><b>Enter the complete APT line of the repository that '
22- 'you want to add as source</b></big>')
23- msg = _("The APT line includes the type, location and components of a "
24- "repository, for example '%s'.") % ("<i>%s</i>" % example)
25+ primary = _('Enter the complete APT line of the repository that '
26+ 'you want to add.')
27+ secondary = _("Include the type, location and components of the "
28+ "repository. Example: %s") % example
29+ text = "%s<br /><br /><small>%s</small>" % primary, secondary
30 self.label_example_line.setWordWrap(True)
31- self.label_example_line.setText(head + '<p>' + msg)
32+ self.label_example_line.setText(text)
33
34 translate_widget(self)
35
36
37=== modified file 'softwareproperties/kde/SoftwarePropertiesKDE.py'
38--- softwareproperties/kde/SoftwarePropertiesKDE.py 2014-12-01 07:04:29 +0000
39+++ softwareproperties/kde/SoftwarePropertiesKDE.py 2015-06-09 11:30:26 +0000
40@@ -702,13 +702,9 @@
41 messageBox.setIcon(QMessageBox.Information)
42 reloadButton = messageBox.addButton(_("Reload"), QMessageBox.AcceptRole)
43 messageBox.addButton(QMessageBox.Close)
44- text = _("<b><big>The information about available software is out-of-date</big></b>\n"
45- "\n"
46- "To install software and updates from newly added or changed sources, you "
47- "have to reload the information about available software.\n"
48- "\n"
49- "You need a working internet connection to continue.")
50- text = text.replace("\n", "<br />")
51+ primary = _("Your local copy of the software catalog is out of date.")
52+ secondary = _("A new copy will be downloaded.")
53+ text = "%s<br /><br /><small>%s</small>" % primary, secondary
54 messageBox.setText(text)
55 messageBox.exec_()
56 if (messageBox.clickedButton() == reloadButton):
57@@ -732,7 +728,8 @@
58 res = cdrom.add(progress)
59 except SystemError as msg:
60 title = _("CD Error")
61- text = _("<big><b>Error scanning the CD</b></big>\n\n%s")%msg
62+ primary = _("Error scanning the CD")
63+ text = "%s\n\n<small>%s</small>") % primary, msg
64 #KMessageBox.sorry(self.userinterface, text, title)
65 QMessageBox.warning(self.userinterface, title, text)
66 return

Subscribers

People subscribed via source and target branches

to status/vote changes: