Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
- New version 1.1.0
- Added Internationalization and Localization (pt-br)
  • Loading branch information
Liz4v committed Oct 6, 2015
2 parents c9293f6 + 10e4176 commit ebdb62a
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 26 deletions.
2 changes: 1 addition & 1 deletion django_oneall/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = '1.0.2'
__version__ = '1.1.0'
3 changes: 2 additions & 1 deletion django_oneall/forms.py
Original file line number Diff line number Diff line change
@@ -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"))
99 changes: 99 additions & 0 deletions django_oneall/locale/pt_BR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>\n"
"Language-Team: Ekevoo <[email protected]>\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:"
20 changes: 11 additions & 9 deletions django_oneall/templates/oneall/login.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<html>
<head lang="en">
{% load i18n %}
<meta charset="UTF-8">
<title>Login</title>
<title>{% trans "Login" %}</title>
{% load oneall %}
{% oneall_header %}
{# Bootstrap is not required. This is just to give us some non-hideous default look. #}
Expand All @@ -11,28 +12,29 @@
<body>
<div class="container">
<div class="row">
<h1>Login</h1>
<h1>{% trans "Login" %}</h1>

{% if login_failed %}
<div id="login_failed">Login failed!</div>
<div id="login_failed">{% trans "Login failed!" %}</div>
{% endif %}

{% if logged_out %}
<div id="logged_out">Logged out!</div>
<div id="logged_out">{% trans "Logged out!" %}</div>
{% endif %}

<div class="col-sm-6">
<h2>Social Login</h2>

<h2>{% trans "Social Login" %}</h2>
{% oneall_social_login %}
</div>

<form method="post" class="col-sm-6">
{% csrf_token %}
<h2>Email Login</h2>
<h2>{% trans "E-mail Login" %}</h2>
{% 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 }} <input type="submit" value=" Login "/>
{{ email_form.as_p }}
<input type="submit" value="{% trans 'Login' %}">
{% endif %}
</form>
</div>
Expand Down
24 changes: 13 additions & 11 deletions django_oneall/templates/oneall/profile.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<html>
<head lang="en">
{% load i18n %}
<meta charset="UTF-8">
<title>Profile</title>
<title>{% trans "Profile" %}</title>
{% load oneall %}
{% oneall_header %}
{# Bootstrap is not required. This is just to give us some non-hideous default look. #}
Expand All @@ -11,30 +12,31 @@
<body>
<div class="container">
<div class="row">
<h1>Welcome</h1>
<h1>{% trans "Welcome" %}</h1>

<div class="col-sm-4 col-xs-12">
<h2>User info</h2>
<h2>{% trans "User info" %}</h2>
<ul>
<li>User #{{ user.id }}: {{ user.username }}</li>
<li>Your OneAll user token is: {{ identity.user_token }}</li>
<li><a href="/">Go home</a></li>
<li><a href="{% url 'oneall-logout' %}">Logout</a></li>
<li>{% blocktrans %}User #{{ user.id }}: {{ user.username }}{% endblocktrans %}</li>
<li>{% blocktrans %}Your OneAll user token is: {{ identity.user_token }}{% endblocktrans %}</li>
<li><a href="/">{% trans "Go home" %}</a></li>
<li><a href="{% url 'oneall-logout' %}">{% trans "Logout" %}</a></li>
</ul>
</div>
<form class="col-sm-4 col-xs-6" method="post">
<h2>Update E-mail</h2>
<h2>{% trans "Update E-mail" %}</h2>

<div>
{% if check_your_mail %}
Check your mail to complete the change.
{% trans "Check your mail to complete the change." %}
{% else %}
{{ form.as_p }}<input type="submit"/>
{{ form.as_p }}
<input type="submit" value="{% trans 'Update' %}">
{% endif %}
</div>
</form>
<div class="col-sm-4 col-xs-6">
<h2>Add Networks</h2>
<h2>{% trans "Add Networks" %}</h2>
{% oneall_social_login user %}
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions django_oneall/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down

0 comments on commit ebdb62a

Please sign in to comment.