diff --git a/django_oneall/__init__.py b/django_oneall/__init__.py index 71fd4a3..c1903b4 100644 --- a/django_oneall/__init__.py +++ b/django_oneall/__init__.py @@ -1,2 +1,2 @@ # -*- coding: utf-8 -*- -__version__ = '1.0.2' +__version__ = '1.1.0' diff --git a/django_oneall/forms.py b/django_oneall/forms.py index 131c4bb..128116f 100644 --- a/django_oneall/forms.py +++ b/django_oneall/forms.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django import forms +from django.utils.translation import ugettext_lazy class EmailForm(forms.Form): - email = forms.EmailField() + email = forms.EmailField(label=ugettext_lazy("E-mail")) diff --git a/django_oneall/locale/pt_BR/LC_MESSAGES/django.po b/django_oneall/locale/pt_BR/LC_MESSAGES/django.po new file mode 100644 index 0000000..d29801d --- /dev/null +++ b/django_oneall/locale/pt_BR/LC_MESSAGES/django.po @@ -0,0 +1,99 @@ +# django-oneall. +# Copyright (C) Leandigo and Ekevoo +# This file is distributed under the same license as the django-oneall package. +# Ekevoo, 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: django-oneall 1.1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-05 02:58+0000\n" +"PO-Revision-Date: 2015-10-05 02:05+0000\n" +"Last-Translator: Ekevoo \n" +"Language-Team: Ekevoo \n" +"Language: Portuguese (Brazilian)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: django-oneall/django_oneall/forms.py:7 +msgid "E-mail" +msgstr "" + +#: django-oneall/django_oneall/templates/oneall/login.html:6 +#: django-oneall/django_oneall/templates/oneall/login.html:15 +#: django-oneall/django_oneall/templates/oneall/login.html:37 +#: django-oneall/django_oneall/views.py:68 +msgid "Login" +msgstr "" + +#: django-oneall/django_oneall/templates/oneall/login.html:18 +msgid "Login failed!" +msgstr "Login falhou!" + +#: django-oneall/django_oneall/templates/oneall/login.html:22 +msgid "Logged out!" +msgstr "Logout com sucesso!" + +#: django-oneall/django_oneall/templates/oneall/login.html:26 +msgid "Social Login" +msgstr "Login Social" + +#: django-oneall/django_oneall/templates/oneall/login.html:32 +msgid "E-mail Login" +msgstr "Login via E-mail" + +#: django-oneall/django_oneall/templates/oneall/login.html:34 +msgid "Check your e-mail for the login link." +msgstr "Veja seu e-mail para o link de login." + +#: django-oneall/django_oneall/templates/oneall/profile.html:6 +msgid "Profile" +msgstr "Perfil" + +#: django-oneall/django_oneall/templates/oneall/profile.html:15 +msgid "Welcome" +msgstr "Bem-vindo" + +#: django-oneall/django_oneall/templates/oneall/profile.html:18 +msgid "User info" +msgstr "Dados pessoais" + +#: django-oneall/django_oneall/templates/oneall/profile.html:20 +#, python-format +msgid "User #%(user.id)s: %(user.username)s" +msgstr "Usuário #%(user.id)s: %(user.username)s" + +#: django-oneall/django_oneall/templates/oneall/profile.html:21 +#, python-format +msgid "Your OneAll user token is: %(identity.user_token)s" +msgstr "Seu token OneAll é: %(identity.user_token)s" + +#: django-oneall/django_oneall/templates/oneall/profile.html:22 +msgid "Go home" +msgstr "Ao começo" + +#: django-oneall/django_oneall/templates/oneall/profile.html:23 +msgid "Logout" +msgstr "" + +#: django-oneall/django_oneall/templates/oneall/profile.html:27 +msgid "Update E-mail" +msgstr "Atualizar E-mail" + +#: django-oneall/django_oneall/templates/oneall/profile.html:31 +msgid "Check your mail to complete the change." +msgstr "Veja seu e-mail para completar a troca." + +#: django-oneall/django_oneall/templates/oneall/profile.html:34 +msgid "Update" +msgstr "Atualizar" + +#: django-oneall/django_oneall/templates/oneall/profile.html:39 +msgid "Add Networks" +msgstr "Adicionar Redes" + +#: django-oneall/django_oneall/views.py:71 +msgid "Complete your login using this link:" +msgstr "Complete seu login usando esse link:" diff --git a/django_oneall/templates/oneall/login.html b/django_oneall/templates/oneall/login.html index 3348036..3af6b91 100644 --- a/django_oneall/templates/oneall/login.html +++ b/django_oneall/templates/oneall/login.html @@ -1,8 +1,9 @@ + {% load i18n %} - Login + {% trans "Login" %} {% load oneall %} {% oneall_header %} {# Bootstrap is not required. This is just to give us some non-hideous default look. #} @@ -11,28 +12,29 @@
-

Login

+

{% trans "Login" %}

{% if login_failed %} -
Login failed!
+
{% trans "Login failed!" %}
{% endif %} {% if logged_out %} -
Logged out!
+
{% trans "Logged out!" %}
{% endif %}
-

Social Login

- +

{% trans "Social Login" %}

{% oneall_social_login %}
+
{% csrf_token %} -

Email Login

+

{% trans "E-mail Login" %}

{% if check_your_mail %} - Check your e-mail for the login link. + {% trans "Check your e-mail for the login link." %} {% else %} - {{ email_form.as_p }} + {{ email_form.as_p }} + {% endif %}
diff --git a/django_oneall/templates/oneall/profile.html b/django_oneall/templates/oneall/profile.html index 8625788..da8280d 100644 --- a/django_oneall/templates/oneall/profile.html +++ b/django_oneall/templates/oneall/profile.html @@ -1,8 +1,9 @@ + {% load i18n %} - Profile + {% trans "Profile" %} {% load oneall %} {% oneall_header %} {# Bootstrap is not required. This is just to give us some non-hideous default look. #} @@ -11,30 +12,31 @@
-

Welcome

+

{% trans "Welcome" %}

-

User info

+

{% trans "User info" %}

    -
  • User #{{ user.id }}: {{ user.username }}
  • -
  • Your OneAll user token is: {{ identity.user_token }}
  • -
  • Go home
  • -
  • Logout
  • +
  • {% blocktrans %}User #{{ user.id }}: {{ user.username }}{% endblocktrans %}
  • +
  • {% blocktrans %}Your OneAll user token is: {{ identity.user_token }}{% endblocktrans %}
  • +
  • {% trans "Go home" %}
  • +
  • {% trans "Logout" %}
-

Update E-mail

+

{% trans "Update E-mail" %}

{% if check_your_mail %} - Check your mail to complete the change. + {% trans "Check your mail to complete the change." %} {% else %} - {{ form.as_p }} + {{ form.as_p }} + {% endif %}
-

Add Networks

+

{% trans "Add Networks" %}

{% oneall_social_login user %}
diff --git a/django_oneall/views.py b/django_oneall/views.py index 88e26c5..e3ea20b 100644 --- a/django_oneall/views.py +++ b/django_oneall/views.py @@ -10,7 +10,7 @@ from django.http.response import HttpResponseRedirectBase from django.middleware.csrf import CsrfViewMiddleware from django.shortcuts import render, resolve_url -from django.utils.translation import ugettext_lazy as _t, ugettext as _tt +from django.utils.translation import ugettext from django.views.decorators.csrf import csrf_exempt from .app import settings @@ -65,10 +65,10 @@ def mail_login_token(request, email, args): args.setlist('next', request.GET.getlist('next')) relative_uri = '%s?%s' % (reverse('oneall-login'), args.urlencode()) message = EmailMessage() - message.subject = _t("Login") + message.subject = ugettext("Login") message.to = [email] message.body = "\n".join([ - _tt("Complete your login using this link:"), + ugettext("Complete your login using this link:"), request.build_absolute_uri(relative_uri), ]) Thread(target=message.send, args=(True,)).start() diff --git a/setup.py b/setup.py index 854f63b..2be9cd5 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ README = open(join(dirname(__file__), 'README.rst')).read() setup( name='django-oneall', - version='1.0.2', + version='1.1.0', packages=find_packages(), package_data={ 'django_oneall/templates/oneall': [