* Mark all model names and field names in influences as translatable strings.
authorMatthijs Kooijman <matthijs@stdin.nl>
Wed, 23 Jan 2008 20:30:54 +0000 (21:30 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Wed, 23 Jan 2008 20:30:54 +0000 (21:30 +0100)
influences/models.py

index ed28de0c0b86ecb09dc4bf55c63e6765001e6b18..7c923cc45b85ba398b17142932321b4486573309 100644 (file)
@@ -1,12 +1,13 @@
 from django.db import models
 from django.contrib.auth.models import User
+from django.utils.translation import ugettext_lazy as _
 
 # Create your models here.
 class Character(models.Model):
-       created     = models.DateField(auto_now_add=1)
-       modified    = models.DateField(auto_now=1)
-       name        = models.CharField(max_length=255)
-       player      = models.ForeignKey(User)
+       created     = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
+       modified    = models.DateField(auto_now=1, verbose_name = _("Modification time"))
+       name        = models.CharField(max_length=255, verbose_name = _("Name"))
+       player      = models.ForeignKey(User, verbose_name = _("Player"))
 
        def __str__(self):
                return self.name
@@ -14,23 +15,32 @@ class Character(models.Model):
        class Admin:
                pass
 
+       class Meta:
+               verbose_name = _("Character")
+               verbose_name_plural = _("Characters")
+
 class Influence(models.Model):
        STATUS_CHOICES = (
                ('N', 'New'),
                ('P', 'Processing'),
                ('D', 'Done'),
        )
-       created     = models.DateField(auto_now_add=1)
-       modified    = models.DateField(auto_now=1)
+       created     = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
+       modified    = models.DateField(auto_now=1, verbose_name = _("Modification time"))
        
-       character   = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True)
-       contact     = models.CharField(max_length=255)
-       description = models.TextField()
-       status      = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N')
-       longterm    = models.BooleanField(default=False)
+       character   = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True, verbose_name = _("Character"))
+       contact     = models.CharField(max_length=255, verbose_name = _("Contact"))
+       description = models.TextField(verbose_name = _("Description"))
+       status      = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N', verbose_name = _("Status"))
+       longterm    = models.BooleanField(default=False, verbose_name = _("Long term"))
 
        def __str__(self):
                return self.description[0:10]
 
        class Admin:
                pass
+
+       class Meta:
+               verbose_name = _("Influence")
+               verbose_name_plural = _("Influences")
+