equal
deleted
inserted
replaced
201 if vocab and not isinstance(vocab[0], (list, tuple)): |
201 if vocab and not isinstance(vocab[0], (list, tuple)): |
202 vocab = [(x, x) for x in vocab] |
202 vocab = [(x, x) for x in vocab] |
203 else: |
203 else: |
204 vocab = form.form_field_vocabulary(self) |
204 vocab = form.form_field_vocabulary(self) |
205 if self.internationalizable: |
205 if self.internationalizable: |
206 vocab = [(form.req._(label), value) for label, value in vocab] |
206 # the short-cirtcuit 'and' boolean operator is used here to permit |
|
207 # a valid empty string in vocabulary without attempting to translate |
|
208 # it by gettext (which can lead to weird strings display) |
|
209 vocab = [(label and form.req._(label), value) for label, value in vocab] |
207 if self.sort: |
210 if self.sort: |
208 vocab = vocab_sort(vocab) |
211 vocab = vocab_sort(vocab) |
209 return vocab |
212 return vocab |
210 |
213 |
211 def form_init(self, form): |
214 def form_init(self, form): |