added translation text for form contact form fields
This commit is contained in:
parent
019f8705bb
commit
34dcf31b00
3 changed files with 60 additions and 1 deletions
|
@ -2,6 +2,7 @@ from django import forms
|
||||||
from .models import Message
|
from .models import Message
|
||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.core.mail import EmailMultiAlternatives
|
from django.core.mail import EmailMultiAlternatives
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class ContactUsForm(forms.ModelForm):
|
class ContactUsForm(forms.ModelForm):
|
||||||
|
@ -16,6 +17,12 @@ class ContactUsForm(forms.ModelForm):
|
||||||
'phone_number': forms.TextInput(attrs={'class': u'form-control'}),
|
'phone_number': forms.TextInput(attrs={'class': u'form-control'}),
|
||||||
'message': forms.Textarea(attrs={'class': u'form-control'}),
|
'message': forms.Textarea(attrs={'class': u'form-control'}),
|
||||||
}
|
}
|
||||||
|
labels = {
|
||||||
|
'name': _('Name'),
|
||||||
|
'email': _('Email'),
|
||||||
|
'phone_number': _('Phone number'),
|
||||||
|
'message': _('Message'),
|
||||||
|
}
|
||||||
|
|
||||||
def send_email(self):
|
def send_email(self):
|
||||||
text_content = render_to_string('emails/contact.txt', {'data': self.cleaned_data})
|
text_content = render_to_string('emails/contact.txt', {'data': self.cleaned_data})
|
||||||
|
|
Binary file not shown.
|
@ -8,7 +8,7 @@ msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2016-04-09 02:43-0500\n"
|
"POT-Creation-Date: 2016-04-09 12:46-0500\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -26,6 +26,58 @@ msgstr ""
|
||||||
msgid "Digital Glarus Supporters"
|
msgid "Digital Glarus Supporters"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: forms.py:21
|
||||||
|
msgid "Name"
|
||||||
|
msgstr "Name"
|
||||||
|
|
||||||
|
#: forms.py:22
|
||||||
|
msgid "Email"
|
||||||
|
msgstr "Email"
|
||||||
|
|
||||||
|
#: forms.py:23
|
||||||
|
msgid "Phone number"
|
||||||
|
msgstr "Telefon"
|
||||||
|
|
||||||
|
#: forms.py:24
|
||||||
|
msgid "Message"
|
||||||
|
msgstr "Nachricht"
|
||||||
|
|
||||||
|
#: templates/glarus_blog/includes/blog_item.html:32
|
||||||
|
msgid "read more"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/includes/blog_meta.html:6
|
||||||
|
msgid "by"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/post_list.html:15
|
||||||
|
msgid "No article found."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/post_list.html:18
|
||||||
|
msgid "Back"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/post_list.html:23
|
||||||
|
msgid "previous"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/post_list.html:26
|
||||||
|
msgid "Page"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/post_list.html:26
|
||||||
|
msgid "of"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/glarus_blog/post_list.html:29
|
||||||
|
msgid "next"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#: templates/language_chooser.html:8
|
||||||
|
msgid "Change to language:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: urls.py:8
|
#: urls.py:8
|
||||||
msgid "contact/?$"
|
msgid "contact/?$"
|
||||||
msgstr "kontakt/?$"
|
msgstr "kontakt/?$"
|
||||||
|
|
Loading…
Reference in a new issue