Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b179dcf0
authored
Feb 05, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: add more localization
parent
d36c3fc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
25 deletions
+120
-25
school/locale/hu/LC_MESSAGES/django.po
+76
-8
school/models.py
+44
-17
No files found.
school/locale/hu/LC_MESSAGES/django.po
View file @
b179dcf0
...
...
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-05
19:27
+0100\n"
"PO-Revision-Date: 2013-02-05 2
0:01
+0100\n"
"POT-Creation-Date: 2013-02-05
22:32
+0100\n"
"PO-Revision-Date: 2013-02-05 2
2:34
+0100\n"
"Last-Translator: \n"
"Language-Team: American English <kde-i18n-doc@kde.org>\n"
"Language: en_US\n"
...
...
@@ -17,7 +17,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"X-Generator: Lokalize 1.4\n"
#: models.py:2
9
#: models.py:2
8 models.py:92
msgid "(none)"
msgstr "(nincs)"
...
...
@@ -26,19 +26,87 @@ msgstr "(nincs)"
msgid "%(first)s %(last)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
msgid "%s (auto)"
msgstr "%s (auto)"
#: models.py:
74 models.py:113
msgid "
n/a
"
msgstr "
n/a
"
#: models.py:
86
msgid "
short name
"
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."
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
msgid "EduID is not available."
msgstr "Az EduID nem elérhető."
...
...
school/models.py
View file @
b179dcf0
...
...
@@ -11,7 +11,6 @@ def create_user_profile(sender, instance, created, **kwargs):
Person
.
objects
.
create
(
user
=
instance
)
except
:
pass
post_save
.
connect
(
create_user_profile
,
sender
=
User
)
class
Person
(
models
.
Model
):
...
...
@@ -28,18 +27,33 @@ class Person(models.Model):
if
not
u
:
return
unicode
(
_
(
"(none)"
))
if
u
.
last_name
and
u
.
first_name
:
# TRANSLATORS: full name format used in enumerations
return
_
(
"
%(first)
s
%(last)
s"
)
%
{
'first'
:
u
.
first_name
,
'last'
:
u
.
last_name
}
else
:
return
u
.
username
class
Meta
:
verbose_name
=
_
(
'person'
)
verbose_name_plural
=
_
(
'persons'
)
class
Course
(
models
.
Model
):
code
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
80
,
null
=
True
,
blank
=
True
)
short_name
=
models
.
CharField
(
max_length
=
10
,
null
=
True
,
blank
=
True
)
code
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
verbose_name
=
_
(
'course code'
))
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
,
related_name
=
'default_group_of'
)
owners
=
models
.
ManyToManyField
(
Person
,
blank
=
True
,
null
=
True
)
related_name
=
'default_group_of'
,
verbose_name
=
_
(
'default group'
),
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
):
if
self
.
default_group
:
return
self
.
default_group
...
...
@@ -50,6 +64,7 @@ class Course(models.Model):
self
.
default_group_id
=
default_group
.
id
self
.
save
()
return
default_group
def
save
(
self
,
*
args
,
**
kwargs
):
if
self
.
default_group
:
self
.
default_group
.
course
=
self
...
...
@@ -62,25 +77,35 @@ class Course(models.Model):
return
u"
%
s (
%
s)"
%
(
self
.
code
,
self
.
name
)
else
:
return
self
.
code
def
short
(
self
):
if
self
.
short_name
:
return
self
.
short_name
else
:
return
self
.
code
short
.
verbose_name
=
_
(
'short name'
)
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
()])
else
:
return
_
(
"n/a"
)
return
_
(
"(none)"
)
owner_list
.
verbose_name
=
_
(
'owners'
)
class
Semester
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
null
=
False
)
start
=
models
.
DateField
()
end
=
models
.
DateField
()
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
null
=
False
,
verbose_name
=
_
(
'name'
))
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
):
return
self
.
start
<=
time
.
date
()
and
self
.
end
>=
time
.
date
()
is_on
.
boolean
=
True
@classmethod
def
get_current
(
cls
):
...
...
@@ -95,22 +120,24 @@ class Semester(models.Model):
return
self
.
name
class
Group
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
80
,
unique
=
True
)
course
=
models
.
ForeignKey
(
'Course'
,
null
=
True
,
blank
=
True
)
semester
=
models
.
ForeignKey
(
'Semester'
,
null
=
False
,
blank
=
False
)
owners
=
models
.
ManyToManyField
(
Person
,
blank
=
True
,
null
=
True
,
related_name
=
'owned_groups'
)
members
=
models
.
ManyToManyField
(
Person
,
blank
=
True
,
null
=
True
,
related_name
=
'course_groups'
)
name
=
models
.
CharField
(
max_length
=
80
,
unique
=
True
,
verbose_name
=
_
(
'name'
)
)
course
=
models
.
ForeignKey
(
'Course'
,
null
=
True
,
blank
=
True
,
verbose_name
=
_
(
'course'
)
)
semester
=
models
.
ForeignKey
(
'Semester'
,
null
=
False
,
blank
=
False
,
verbose_name
=
_
(
'semester'
)
)
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'
,
verbose_name
=
_
(
'members'
)
)
class
Meta
:
unique_together
=
((
'name'
,
'course'
,
'semester'
,
),
)
verbose_name
=
_
(
'group'
)
verbose_name_plural
=
_
(
'groups'
)
def
owner_list
(
self
):
if
self
.
owners
:
return
", "
.
join
([
p
.
short_name
()
for
p
in
self
.
owners
.
all
()])
else
:
return
_
(
"n/a"
)
owner_list
.
verbose_name
=
_
(
'owners'
)
def
member_count
(
self
):
return
self
.
members
.
count
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment