diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/models.py | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index e33fb73e4..7798c722d 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1478,6 +1478,19 @@ FIND_INDEX_SOURCE = ((u"O", _(u"Operations")), (u"CR", _(u"Context records"))) SITE_LABELS = [('site', _(u"Site")), ('entity', _(u"Archaeological site"))] +TRANSLATED_SITE_LABELS = { + 'site': { + 'search': _(u"Site search"), + 'new': _(u"New site"), + 'modification': _(u"Site modification"), + }, + 'entity': { + 'search': _(u"Archaeological site search"), + 'new': _(u"New archaeological site"), + 'modification': _(u"Archaeological site modification"), + }, +} + class IshtarSiteProfile(models.Model, Cached): slug_field = 'slug' @@ -1596,11 +1609,15 @@ class IshtarSiteProfile(models.Model, Cached): return obj @classmethod - def get_default_site_label(cls): - return cls.get_current_profile().get_site_label() + def get_default_site_label(cls, key=None): + return cls.get_current_profile().get_site_label(key) - def get_site_label(self): - return unicode(dict(SITE_LABELS)[self.archaeological_site_label]) + def get_site_label(self, key=None): + if not key: + return unicode(dict(SITE_LABELS)[self.archaeological_site_label]) + return unicode( + TRANSLATED_SITE_LABELS[self.archaeological_site_label][key] + ) def save(self, *args, **kwargs): raw = False |