Skip to content

Hint 3 spoiler

Sébastiaan edited this page Mar 5, 2020 · 2 revisions

First go back to the Profile model and change the attribute field from new_field to shoe_size and add _('Shoe size') as verbose_name. Your code should now look like this:

.......

class Profile(models.Model):
    """This class holds extra information about a member"""

.......

    # ---- Personal information ------

    programme = models.CharField(
        max_length=20,
        choices=PROGRAMME_CHOICES,
        verbose_name=_('Study programme'),
        blank=True,
        null=True,
    )

    shoe_size = models.IntegerField(
        verbose_name=_('Shoe size')
    )
    
.......

Now, since concrexit is multilingual we need to generate the new translations. Make sure you have a .po editor installed, poedit for example.

  1. cd into the website/members directory
  2. ../manage.py makemessages --locale nl
  3. This creates or updates locale/nl/LC_MESSAGES/django.po
  4. Start poedit (for example) by calling poedit locale/nl/LC_MESSAGES/django.po
  5. Add the Dutch translation for Shoe size and save.
  6. Execute ../manage.py compilemessages (this should happen automatically when saving the file in poedit)
  7. Commit both the .po and .mo file to the repository
Clone this wiki locally