# HG changeset patch # User Julien Jehannet # Date 1257176239 -3600 # Node ID 34fdb8fb49d110ad087d5472dddd5d5a5715f10c # Parent fb22b55f80f88f215fa494c65c3827477eb136d9 [B] web: weird display with internationalizable (Closes: #503071) diff -r fb22b55f80f8 -r 34fdb8fb49d1 web/formfields.py --- a/web/formfields.py Mon Nov 02 16:10:03 2009 +0100 +++ b/web/formfields.py Mon Nov 02 16:37:19 2009 +0100 @@ -203,7 +203,10 @@ else: vocab = form.form_field_vocabulary(self) if self.internationalizable: - vocab = [(form.req._(label), value) for label, value in vocab] + # the short-cirtcuit 'and' boolean operator is used here to permit + # a valid empty string in vocabulary without attempting to translate + # it by gettext (which can lead to weird strings display) + vocab = [(label and form.req._(label), value) for label, value in vocab] if self.sort: vocab = vocab_sort(vocab) return vocab