1.1 --- a/imipweb/profile.py Wed Nov 04 23:35:16 2015 +0100
1.2 +++ b/imipweb/profile.py Thu Nov 05 00:58:02 2015 +0100
1.3 @@ -115,6 +115,8 @@
1.4
1.5 "Show the preferences, indicating any 'errors' in the output."
1.6
1.7 + _ = self.get_translator()
1.8 +
1.9 page = self.page
1.10 settings = self.get_current_preferences()
1.11 prefs = self.get_preferences()
1.12 @@ -145,10 +147,16 @@
1.13 page.th.close()
1.14 page.td()
1.15
1.16 + # For unrestricted fields, show a text field.
1.17 +
1.18 if not choices:
1.19 page.input(name=name, value=(value or default), type="text", class_="preference", id_=name)
1.20 +
1.21 + # Otherwise, obtain the choices, localise the labels and show a
1.22 + # menu control.
1.23 +
1.24 else:
1.25 - choices = list(choices.items())
1.26 + choices = [(key, _(label)) for (key, label) in choices.items()]
1.27 choices.sort()
1.28 self.menu(name, default, choices, value is not None and [value] or None, class_="preference")
1.29