Commit b179dcf0 by Őry Máté

school: add more localization

parent d36c3fc2
...@@ -6,8 +6,8 @@ msgid "" ...@@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-05 19:27+0100\n" "POT-Creation-Date: 2013-02-05 22:32+0100\n"
"PO-Revision-Date: 2013-02-05 20:01+0100\n" "PO-Revision-Date: 2013-02-05 22:34+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: American English <kde-i18n-doc@kde.org>\n" "Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: en_US\n" "Language: en_US\n"
...@@ -17,7 +17,7 @@ msgstr "" ...@@ -17,7 +17,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1)\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n"
"X-Generator: Lokalize 1.4\n" "X-Generator: Lokalize 1.4\n"
#: models.py:29 #: models.py:28 models.py:92
msgid "(none)" msgid "(none)"
msgstr "(nincs)" msgstr "(nincs)"
...@@ -26,19 +26,87 @@ msgstr "(nincs)" ...@@ -26,19 +26,87 @@ msgstr "(nincs)"
msgid "%(first)s %(last)s" msgid "%(first)s %(last)s"
msgstr "%(last)s %(first)s" msgstr "%(last)s %(first)s"
#: models.py:47 #: models.py:37
msgid "person"
msgstr "személy"
#: models.py:38
msgid "persons"
msgstr "személyek"
#: models.py:42
msgid "course code"
msgstr "tárgykód"
#: models.py:44 models.py:46 models.py:98 models.py:124
msgid "name"
msgstr "név"
#: models.py:48
msgid "default group"
msgstr "alapértelmezett csoport"
#: models.py:49
msgid "New users will automatically get to this group."
msgstr "Az új hallgatók automatikusan ebbe a csoportba kerülnek."
#: models.py:51 models.py:93 models.py:127 models.py:140
msgid "owners"
msgstr "tulajdonosok"
#: models.py:54 models.py:125
msgid "course"
msgstr "tárgy"
#: models.py:55
msgid "courses"
msgstr "tárgyak"
#: models.py:61
#, python-format #, python-format
msgid "%s (auto)" msgid "%s (auto)"
msgstr "%s (auto)" msgstr "%s (auto)"
#: models.py:74 models.py:113 #: models.py:86
msgid "n/a" msgid "short name"
msgstr "n/a" msgstr "rövid név"
#: models.py:92 #: models.py:99
msgid "start"
msgstr "kezdet"
#: models.py:100
msgid "end"
msgstr "vége"
#: models.py:103 models.py:126
msgid "semester"
msgstr "félév"
#: models.py:104
msgid "semesters"
msgstr "félévek"
#: models.py:117
msgid "There is no current semester." msgid "There is no current semester."
msgstr "Nincs aktuális félév." msgstr "Nincs aktuális félév."
#: models.py:128
msgid "members"
msgstr "tagok"
#: models.py:132
msgid "group"
msgstr "csoport"
#: models.py:133
msgid "groups"
msgstr "csoportok"
#: models.py:139
msgid "n/a"
msgstr "n/a"
#: views.py:39 #: views.py:39
msgid "EduID is not available." msgid "EduID is not available."
msgstr "Az EduID nem elérhető." msgstr "Az EduID nem elérhető."
......
...@@ -11,7 +11,6 @@ def create_user_profile(sender, instance, created, **kwargs): ...@@ -11,7 +11,6 @@ def create_user_profile(sender, instance, created, **kwargs):
Person.objects.create(user=instance) Person.objects.create(user=instance)
except: except:
pass pass
post_save.connect(create_user_profile, sender=User) post_save.connect(create_user_profile, sender=User)
class Person(models.Model): class Person(models.Model):
...@@ -28,18 +27,33 @@ class Person(models.Model): ...@@ -28,18 +27,33 @@ class Person(models.Model):
if not u: if not u:
return unicode(_("(none)")) return unicode(_("(none)"))
if u.last_name and u.first_name: if u.last_name and u.first_name:
# TRANSLATORS: full name format used in enumerations
return _("%(first)s %(last)s") % {'first': u.first_name, return _("%(first)s %(last)s") % {'first': u.first_name,
'last': u.last_name} 'last': u.last_name}
else: else:
return u.username return u.username
class Meta:
verbose_name = _('person')
verbose_name_plural = _('persons')
class Course(models.Model): class Course(models.Model):
code = models.CharField(max_length=20, unique=True) code = models.CharField(max_length=20, unique=True,
name = models.CharField(max_length=80, null=True, blank=True) verbose_name=_('course code'))
short_name = models.CharField(max_length=10, null=True, blank=True) name = models.CharField(max_length=80, null=True, blank=True,
verbose_name=_('name'))
short_name = models.CharField(max_length=10, null=True, blank=True,
verbose_name=_('name'))
default_group = models.ForeignKey('Group', null=True, blank=True, default_group = models.ForeignKey('Group', null=True, blank=True,
related_name='default_group_of') related_name='default_group_of', verbose_name=_('default group'),
owners = models.ManyToManyField(Person, blank=True, null=True) help_text=_('New users will automatically get to this group.'))
owners = models.ManyToManyField(Person, blank=True, null=True,
verbose_name=_('owners'))
class Meta:
verbose_name = _('course')
verbose_name_plural = _('courses')
def get_or_create_default_group(self): def get_or_create_default_group(self):
if self.default_group: if self.default_group:
return self.default_group return self.default_group
...@@ -50,6 +64,7 @@ class Course(models.Model): ...@@ -50,6 +64,7 @@ class Course(models.Model):
self.default_group_id = default_group.id self.default_group_id = default_group.id
self.save() self.save()
return default_group return default_group
def save(self, *args, **kwargs): def save(self, *args, **kwargs):
if self.default_group: if self.default_group:
self.default_group.course = self self.default_group.course = self
...@@ -62,25 +77,35 @@ class Course(models.Model): ...@@ -62,25 +77,35 @@ class Course(models.Model):
return u"%s (%s)" % (self.code, self.name) return u"%s (%s)" % (self.code, self.name)
else: else:
return self.code return self.code
def short(self): def short(self):
if self.short_name: if self.short_name:
return self.short_name return self.short_name
else: else:
return self.code return self.code
short.verbose_name = _('short name')
def owner_list(self): def owner_list(self):
if self.owners: if self.owners and self.owners.count() > 0:
return ", ".join([p.short_name() for p in self.owners.all()]) return ", ".join([p.short_name() for p in self.owners.all()])
else: else:
return _("n/a") return _("(none)")
owner_list.verbose_name = _('owners')
class Semester(models.Model): class Semester(models.Model):
name = models.CharField(max_length=20, unique=True, null=False) name = models.CharField(max_length=20, unique=True, null=False,
start = models.DateField() verbose_name=_('name'))
end = models.DateField() start = models.DateField(verbose_name=_('start'))
end = models.DateField(verbose_name=_('end'))
class Meta:
verbose_name = _('semester')
verbose_name_plural = _('semesters')
def is_on(self, time): def is_on(self, time):
return self.start <= time.date() and self.end >= time.date() return self.start <= time.date() and self.end >= time.date()
is_on.boolean = True
@classmethod @classmethod
def get_current(cls): def get_current(cls):
...@@ -95,22 +120,24 @@ class Semester(models.Model): ...@@ -95,22 +120,24 @@ class Semester(models.Model):
return self.name return self.name
class Group(models.Model): class Group(models.Model):
name = models.CharField(max_length=80, unique=True) name = models.CharField(max_length=80, unique=True, verbose_name=_('name'))
course = models.ForeignKey('Course', null=True, blank=True) course = models.ForeignKey('Course', null=True, blank=True, verbose_name=_('course'))
semester = models.ForeignKey('Semester', null=False, blank=False) semester = models.ForeignKey('Semester', null=False, blank=False, verbose_name=_('semester'))
owners = models.ManyToManyField(Person, blank=True, null=True, related_name='owned_groups') owners = models.ManyToManyField(Person, blank=True, null=True, related_name='owned_groups', verbose_name=_('owners'))
members = models.ManyToManyField(Person, blank=True, null=True, related_name='course_groups') members = models.ManyToManyField(Person, blank=True, null=True, related_name='course_groups', verbose_name=_('members'))
class Meta: class Meta:
unique_together = (('name', 'course', 'semester', ), ) unique_together = (('name', 'course', 'semester', ), )
verbose_name = _('group')
verbose_name_plural = _('groups')
def owner_list(self): def owner_list(self):
if self.owners: if self.owners:
return ", ".join([p.short_name() for p in self.owners.all()]) return ", ".join([p.short_name() for p in self.owners.all()])
else: else:
return _("n/a") return _("n/a")
owner_list.verbose_name = _('owners')
def member_count(self): def member_count(self):
return self.members.count() return self.members.count()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment