Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Brazilian Portuguese translation #183

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include LICENSE
include README.rst
recursive-include easyaudit/static *
recursive-include easyaudit/templates *
recursive-include easyaudit/locale *
17 changes: 9 additions & 8 deletions easyaudit/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import gettext_lazy as _

try: # Django 2.0
from django.urls import reverse
Expand Down Expand Up @@ -36,12 +37,12 @@ def get_changelist_instance(self, *args, **kwargs):
def get_content_type(self, obj):
return self.content_types_by_id[obj.content_type_id]

get_content_type.short_description = "Content Type"
get_content_type.short_description = _("Content Type")

def get_user(self, obj):
return self.users_by_id.get(obj.user_id)

get_user.short_description = "User"
get_user.short_description = _("User")

def object_repr_link(self, obj):
if obj.event_type == CRUDEvent.DELETE:
Expand All @@ -59,17 +60,17 @@ def object_repr_link(self, obj):
html = escaped_obj_repr
return mark_safe(html)

object_repr_link.short_description = 'object repr'
object_repr_link.short_description = _('object repr')

def object_json_repr_prettified(self, obj):
return prettify_json(obj.object_json_repr)

object_json_repr_prettified.short_description = 'object json repr'
object_json_repr_prettified.short_description = _('object json repr')

def changed_fields_prettified(self, obj):
return prettify_json(obj.changed_fields)

changed_fields_prettified.short_description = 'changed fields'
changed_fields_prettified.short_description = _('changed fields')


if settings.ADMIN_SHOW_MODEL_EVENTS:
Expand All @@ -87,14 +88,14 @@ class LoginEventAdmin(EasyAuditModelAdmin):
def get_user(self, obj):
return self.users_by_id.get(obj.user_id)

get_user.short_description = "User"
get_user.short_description = _("User")

def get_username(self, obj):
user = self.get_user(obj)
username = user.get_username() if user else None
return username

get_username.short_description = "User name"
get_username.short_description = _("User name")


if settings.ADMIN_SHOW_AUTH_EVENTS:
Expand All @@ -112,7 +113,7 @@ class RequestEventAdmin(EasyAuditModelAdmin):
def get_user(self, obj):
return self.users_by_id.get(obj.user_id)

get_user.short_description = "User"
get_user.short_description = _("User")


if settings.ADMIN_SHOW_REQUEST_EVENTS:
Expand Down
2 changes: 1 addition & 1 deletion easyaudit/admin_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def user_link(self, obj):
except Exception:
html = escaped
return mark_safe(html)
user_link.short_description = 'user'
user_link.short_description = _('user')

def has_add_permission(self, request, obj=None):
return False
Expand Down
3 changes: 2 additions & 1 deletion easyaudit/apps.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _

class EasyAuditConfig(AppConfig):
name = 'easyaudit'
verbose_name = 'Easy Audit Application'
verbose_name = _('Easy Audit Application')
default_auto_field = 'django.db.models.AutoField'

def ready(self):
Expand Down
Binary file added easyaudit/locale/pt_BR/LC_MESSAGES/django.mo
Binary file not shown.
234 changes: 234 additions & 0 deletions easyaudit/locale/pt_BR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-04-12 13:27-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: \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"

#: .\admin.py:40
msgid "Content Type"
msgstr "Tipo de Conteúdo"

#: .\admin.py:45 .\admin.py:91 .\admin.py:116 .\models.py:38 .\models.py:72
#: .\models.py:88
msgid "User"
msgstr "Usuário"

#: .\admin.py:63
msgid "object repr"
msgstr "representação do objeto"

#: .\admin.py:68
msgid "object json repr"
msgstr "representação json do objeto"

#: .\admin.py:73
msgid "changed fields"
msgstr "campos alterados"

#: .\admin.py:98
msgid "User name"
msgstr "nome do usuário"

#: .\admin_helpers.py:65
msgid "user"
msgstr "usuário"

#: .\admin_helpers.py:122
#, python-format
msgid "Successfully removed %d rows"
msgstr "%d linhas removidas com sucesso"

#: .\admin_helpers.py:124
msgid "ERROR"
msgstr "ERRO"

#: .\admin_helpers.py:126
msgid "Action cancelled by user"
msgstr "Ação cancelada pelo usuário"

#: .\admin_helpers.py:130
#, python-format
msgid "Purge all %s ... are you sure?"
msgstr "Eliminar todos os %s ... tem certeza?"

#: .\apps.py:6
msgid "Easy Audit Application"
msgstr "Aplicação Easy Audit"

#: .\models.py:19
msgid "Create"
msgstr "Criar"

#: .\models.py:20
msgid "Update"
msgstr "Atualizar"

#: .\models.py:21
msgid "Delete"
msgstr "Excluir"

#: .\models.py:22
msgid "Many-to-Many Change"
msgstr "Mudança muitos para muitos"

#: .\models.py:23
msgid "Reverse Many-to-Many Change"
msgstr "Reverter mudança muitos para muitos"

#: .\models.py:24
msgid "Many-to-Many Add"
msgstr "Adicionar muitos para muitos"

#: .\models.py:25
msgid "Reverse Many-to-Many Add"
msgstr "Reverter Adição muitos para muitos"

#: .\models.py:26
msgid "Many-to-Many Remove"
msgstr "Remover muitos para muitos"

#: .\models.py:27
msgid "Reverse Many-to-Many Remove"
msgstr "Reverter Remoção muitos para muitos"

#: .\models.py:30 .\models.py:68
msgid "Event type"
msgstr "Tipo de Evento"

#: .\models.py:31
msgid "Object ID"
msgstr "ID do Objeto"

#: .\models.py:32
msgid "Content type"
msgstr "Tipo de conteúdo"

#: .\models.py:33
msgid "Object representation"
msgstr "Representação do Objeto"

#: .\models.py:34
msgid "Object JSON representation"
msgstr "Representação JSON do Objeto"

#: .\models.py:35
msgid "Changed fields"
msgstr "Campos Alterados"

#: .\models.py:40
msgid "String version of the user pk"
msgstr "Versão string da PK do usuário"

#: .\models.py:40
msgid "User PK as string"
msgstr "PK do usuário como string"

#: .\models.py:41 .\models.py:74 .\models.py:90
msgid "Date time"
msgstr "Data e Hora"

#: .\models.py:53
msgid "CRUD event"
msgstr "Evento CRUD"

#: .\models.py:54
msgid "CRUD events"
msgstr "Eventos CRUD"

#: .\models.py:64
msgid "Login"
msgstr "Login"

#: .\models.py:65
msgid "Logout"
msgstr "Logout"

#: .\models.py:66
msgid "Failed login"
msgstr "Falha no login"

#: .\models.py:69
msgid "Username"
msgstr "Nome do usuário"

#: .\models.py:73 .\models.py:89
msgid "Remote IP"
msgstr "IP Remoto"

#: .\models.py:77
msgid "login event"
msgstr "Evento de Login"

#: .\models.py:78
msgid "login events"
msgstr "Eventos de Login"

#: .\models.py:83
msgid "URL"
msgstr "URL"

#: .\models.py:84
msgid "Method"
msgstr "Método"

#: .\models.py:85
msgid "Query string"
msgstr "String de Consulta"

#: .\models.py:93
msgid "request event"
msgstr "Evento de Solicitação"

#: .\models.py:94
msgid "request events"
msgstr "Eventos de Solicitação"

#: .\templates\admin\easyaudit\change_list.html:10
#, python-format
msgid "Purge %(name)s"
msgstr "Limpar %(name)s"

#: .\templates\admin\easyaudit\purge_confirmation.html:7
msgid "Home"
msgstr "Home"

#: .\templates\admin\easyaudit\purge_confirmation.html:10
msgid "Purge"
msgstr "Limpar"

#: .\templates\admin\easyaudit\purge_confirmation.html:19
msgid "Please confirm deletion"
msgstr "Por favor, confirme a exclusão"

#: .\templates\admin\easyaudit\purge_confirmation.html:20
msgid ""
"This operation is destructive, cannot be undone and may require some minutes."
msgstr ""
"Esta operação é destrutiva, não pode ser desfeita e pode demorar alguns "
"minutos."

#: .\templates\admin\easyaudit\purge_confirmation.html:21
msgid "Are you sure you want to permanently remove all objects ?"
msgstr "Tem certeza de que deseja remover todos os objetos permanentemente?"

#: .\templates\admin\easyaudit\purge_confirmation.html:25
msgid "Yes, I'm sure"
msgstr "Sim eu tenho certeza"

#: .\templates\admin\easyaudit\purge_confirmation.html:26
msgid "Cancel"
msgstr "Cancelar"
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h4 class="alert-heading">{% trans 'Please confirm deletion' %}.</h4>
<br>

<div class="submit-row">
<input type="submit" class="btn btn-danger deletelink" name="btn-confirm" value="{% trans 'Yes, I\'m sure' %}" />
<input type="submit" class="btn btn-danger deletelink" name="btn-confirm" value="{% blocktrans %}Yes, I'm sure{% endblocktrans %}" />
<input type="submit" class="btn" name="btn-cancel" value="{% trans 'Cancel' %}" />
</div>
</div>
Expand Down