diff options
| author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-04-11 18:05:05 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-04-11 18:05:05 +0200 | 
| commit | f7ef537f915f30ea8513c18f43d79733a5d47ac2 (patch) | |
| tree | 3898e42a7a454b74a16446d5f642e9a18581e17b | |
| parent | f6428834b80e5d0d4aab1855aa60ace3ebef9c2c (diff) | |
| download | Ishtar-f7ef537f915f30ea8513c18f43d79733a5d47ac2.tar.bz2 Ishtar-f7ef537f915f30ea8513c18f43d79733a5d47ac2.zip | |
Fix translation of title (closes #593)
| -rw-r--r-- | ishtar_common/models.py | 3 | ||||
| -rw-r--r-- | ishtar_common/wizards.py | 3 | 
2 files changed, 6 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index fd5bb5871..3e428999e 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -163,6 +163,9 @@ class GeneralType(models.Model):      def __unicode__(self):          return self.label +    def short_label(self): +        return self.label +      @classmethod      def get_help(cls, dct={}, exclude=[]):          help_text = cls.HELP_TEXT diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index e421c25dd..699c3a858 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -33,6 +33,7 @@ class Wizard(NamedUrlWizardView):      label = ''      modification = None # True when the wizard modify an item      storage_name = 'django.contrib.formtools.wizard.storage.session.SessionStorage' +    translated_keys = ['title']      @staticmethod      def _check_right(step, condition=True): @@ -203,6 +204,8 @@ class Wizard(NamedUrlWizardView):                      value = cleaned_data[key]                      if not value and value != False:                          continue +                    if key in self.translated_keys: +                        value = _(value)                      if type(value) == bool:                          if value == True:                              value = _(u"Yes") | 
