Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
MOOC packages by hacklab
django-courses
Commits
d1b1976a
Commit
d1b1976a
authored
May 20, 2021
by
Matheus Miranda
Browse files
Add translation for certificate template
parent
6d25b2bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
187 additions
and
0 deletions
+187
-0
courses/certification/migrations/0006_auto_20210520_1724.py
courses/certification/migrations/0006_auto_20210520_1724.py
+179
-0
courses/translation.py
courses/translation.py
+8
-0
No files found.
courses/certification/migrations/0006_auto_20210520_1724.py
0 → 100644
View file @
d1b1976a
# Generated by Django 2.2.23 on 2021-05-20 20:24
import
courses.utils
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'certification'
,
'0005_auto_20210520_1126'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'base_logo_en'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'base_logo'
,
'organization_name'
),
verbose_name
=
'Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'base_logo_es'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'base_logo'
,
'organization_name'
),
verbose_name
=
'Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'base_logo_pt_br'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'base_logo'
,
'organization_name'
),
verbose_name
=
'Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'cert_logo_en'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'logo'
,
'organization_name'
),
verbose_name
=
'Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'cert_logo_es'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'logo'
,
'organization_name'
),
verbose_name
=
'Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'cert_logo_pt_br'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'logo'
,
'organization_name'
),
verbose_name
=
'Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'name_en'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Signature Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'name_es'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Signature Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'name_pt_br'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Signature Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'organization_name_en'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'organization_name_es'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'organization_name_pt_br'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'role_en'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
,
verbose_name
=
'Role'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'role_es'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
,
verbose_name
=
'Role'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'role_pt_br'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
,
verbose_name
=
'Role'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_name_en'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Second Signature Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_name_es'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Second Signature Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_name_pt_br'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
,
null
=
True
,
verbose_name
=
'Second Signature Name'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_role_en'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
,
verbose_name
=
'Second Role'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_role_es'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
,
verbose_name
=
'Second Role'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_role_pt_br'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
,
verbose_name
=
'Second Role'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_signature_en'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'second_signature'
,
'organization_name'
),
verbose_name
=
'Second Signature'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_signature_es'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'second_signature'
,
'organization_name'
),
verbose_name
=
'Second Signature'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'second_signature_pt_br'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'second_signature'
,
'organization_name'
),
verbose_name
=
'Second Signature'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'signature_en'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'signature'
,
'organization_name'
),
verbose_name
=
'Signature'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'signature_es'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'signature'
,
'organization_name'
),
verbose_name
=
'Signature'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'signature_pt_br'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
courses
.
utils
.
HashName
(
'signature'
,
'organization_name'
),
verbose_name
=
'Signature'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'site_logo_en'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
'certificates_files'
,
verbose_name
=
'Site Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'site_logo_es'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
'certificates_files'
,
verbose_name
=
'Site Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'site_logo_pt_br'
,
field
=
models
.
ImageField
(
blank
=
True
,
null
=
True
,
upload_to
=
'certificates_files'
,
verbose_name
=
'Site Logo'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'text_en'
,
field
=
models
.
TextField
(
default
=
''
,
null
=
True
,
verbose_name
=
'Content'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'text_es'
,
field
=
models
.
TextField
(
default
=
''
,
null
=
True
,
verbose_name
=
'Content'
),
),
migrations
.
AddField
(
model_name
=
'certificatetemplate'
,
name
=
'text_pt_br'
,
field
=
models
.
TextField
(
default
=
''
,
null
=
True
,
verbose_name
=
'Content'
),
),
]
courses/translation.py
View file @
d1b1976a
...
@@ -2,6 +2,7 @@ from modeltranslation.translator import register, TranslationOptions
...
@@ -2,6 +2,7 @@ from modeltranslation.translator import register, TranslationOptions
from
.models
import
Course
,
Lesson
,
Unit
,
ProfessorMessage
from
.models
import
Course
,
Lesson
,
Unit
,
ProfessorMessage
from
.course_material.models
import
CourseMaterial
,
File
from
.course_material.models
import
CourseMaterial
,
File
from
.stats.models
import
AccessibleArea
from
.stats.models
import
AccessibleArea
from
.certification.models
import
CertificateTemplate
@
register
(
Course
)
@
register
(
Course
)
...
@@ -40,3 +41,10 @@ class FileTranslationOptions(TranslationOptions):
...
@@ -40,3 +41,10 @@ class FileTranslationOptions(TranslationOptions):
@
register
(
AccessibleArea
)
@
register
(
AccessibleArea
)
class
AccessibleAreaTranslationOptions
(
TranslationOptions
):
class
AccessibleAreaTranslationOptions
(
TranslationOptions
):
fields
=
(
'name'
,
'slug'
)
fields
=
(
'name'
,
'slug'
)
@
register
(
CertificateTemplate
)
class
CertificateTemplateTranslationOptions
(
TranslationOptions
):
fields
=
(
'role'
,
'name'
,
'second_role'
,
'second_name'
,
'cert_logo'
,
'base_logo'
,
'signature'
,
'second_signature'
,
'site_logo'
,
'organization_name'
,
'text'
)
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