From 7134e6991e84c566425cfa941c0dfdca29c811b9 Mon Sep 17 00:00:00 2001 From: Jailson Dias Date: Wed, 29 Mar 2017 17:31:55 -0300 Subject: [PATCH] Resolvendo problemas de texto nos modais do mural --- mural/forms.py | 9 ++++++++- mural/locale/pt-br/LC_MESSAGES/django.po | 241 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- mural/locale/pt_BR/LC_MESSAGES/django.po | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------- mural/models.py | 8 ++++---- mural/templates/mural/_view_comment.html | 4 ++-- 5 files changed, 142 insertions(+), 393 deletions(-) delete mode 100644 mural/locale/pt-br/LC_MESSAGES/django.po diff --git a/mural/forms.py b/mural/forms.py index 5816408..ad682cb 100644 --- a/mural/forms.py +++ b/mural/forms.py @@ -1,6 +1,6 @@ # coding=utf-8 from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _, pgettext_lazy from django.utils.html import strip_tags from django.db.models import Q @@ -13,6 +13,11 @@ from .models import GeneralPost, CategoryPost, SubjectPost, Comment class Validation(forms.ModelForm): MAX_UPLOAD_SIZE = 5*1024*1024 + def __init__(self, *args, **kwargs): + super(Validation, self).__init__(*args, **kwargs) + CHOICES = (("comment", pgettext_lazy("form","Comment")), ("help", pgettext_lazy("form","Ask for Help"))) + self.fields['action'].choices = CHOICES + def clean_post(self): post = self.cleaned_data.get('post', '') cleaned_post = strip_tags(post) @@ -38,9 +43,11 @@ class Validation(forms.ModelForm): class GeneralPostForm(Validation): + class Meta: model = GeneralPost fields = ['action', 'post', 'image'] + widgets = { 'action': forms.RadioSelect, 'post': forms.Textarea, diff --git a/mural/locale/pt-br/LC_MESSAGES/django.po b/mural/locale/pt-br/LC_MESSAGES/django.po deleted file mode 100644 index d2775cd..0000000 --- a/mural/locale/pt-br/LC_MESSAGES/django.po +++ /dev/null @@ -1,241 +0,0 @@ -# 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 , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-09 18:40-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: mural/forms.py:16 mural/forms.py:51 -msgid "This field is required." -msgstr "" - -#: mural/forms.py:28 mural/forms.py:63 -msgid "The image is too large. It should have less than 5MB." -msgstr "" - -#: mural/models.py:18 -msgid "File not supported." -msgstr "" - -#: mural/models.py:21 -msgid "Action" -msgstr "" - -#: mural/models.py:21 mural/models.py:66 mural/models.py:79 -#: mural/templates/mural/_view_comment.html:14 -msgid "Comment" -msgstr "" - -#: mural/models.py:21 -msgid "Ask for Help" -msgstr "" - -#: mural/models.py:22 mural/models.py:68 mural/models.py:78 mural/models.py:86 -msgid "Post" -msgstr "" - -#: mural/models.py:23 mural/models.py:67 -msgid "Image" -msgstr "" - -#: mural/models.py:24 mural/models.py:69 mural/models.py:80 mural/models.py:87 -msgid "User" -msgstr "" - -#: mural/models.py:25 mural/models.py:70 -msgid "Create Date" -msgstr "" - -#: mural/models.py:26 mural/models.py:71 -msgid "Last Update" -msgstr "" - -#: mural/models.py:27 -msgid "Edited" -msgstr "" - -#: mural/models.py:38 -msgid "Space" -msgstr "" - -#: mural/models.py:56 -msgid "Subject" -msgstr "" - -#: mural/models.py:57 -msgid "Resource" -msgstr "" - -#: mural/models.py:77 -msgid "Viewed" -msgstr "" - -#: mural/templates/mural/_form.html:54 -#: mural/templates/mural/_form_comment.html:33 -msgid "Choose your photo..." -msgstr "" - -#: mural/templates/mural/_form.html:63 -#: mural/templates/mural/_form_comment.html:42 -msgid "Click or drop the file here" -msgstr "" - -#: mural/templates/mural/_form.html:65 -#: mural/templates/mural/_form_comment.html:44 -msgid "The file could not exceed 5MB." -msgstr "" - -#: mural/templates/mural/_form.html:87 -#: mural/templates/mural/_form_comment.html:66 -msgid "Save" -msgstr "" - -#: mural/templates/mural/_form.html:88 -#: mural/templates/mural/_form_comment.html:67 -#: mural/templates/mural/_form_comment.html:91 -msgid "Cancel" -msgstr "" - -#: mural/templates/mural/_form_comment.html:77 -msgid "Mark user in comment" -msgstr "" - -#: mural/templates/mural/_form_comment.html:80 -msgid "Type the user name in the field below" -msgstr "" - -#: mural/templates/mural/_form_comment.html:90 -msgid "Mark" -msgstr "" - -#: mural/templates/mural/_form_comment.html:106 -msgid "Mark User" -msgstr "" - -#: mural/templates/mural/_user_suggestions_list.html:16 -msgid "No results found." -msgstr "" - -#: mural/templates/mural/_view.html:21 -#: mural/templates/mural/_view_comment.html:22 -msgid "Edit" -msgstr "" - -#: mural/templates/mural/_view.html:23 -#: mural/templates/mural/_view_comment.html:24 -msgid "Remove" -msgstr "" - -#: mural/templates/mural/_view.html:35 -#: mural/templates/mural/_view_comment.html:31 -msgid "In" -msgstr "" - -#: mural/templates/mural/_view.html:59 -msgid "Make a comment..." -msgstr "" - -#: mural/templates/mural/delete.html:8 -msgid "Are you sure you want to delete this post" -msgstr "" - -#: mural/templates/mural/delete.html:13 -msgid "Close" -msgstr "" - -#: mural/templates/mural/delete.html:16 -msgid "Delete" -msgstr "" - -#: mural/templates/mural/list.html:9 -msgid "Mural: General" -msgstr "" - -#: mural/templates/mural/list.html:17 -msgid "General" -msgstr "" - -#: mural/templates/mural/list.html:18 -msgid "Per Category" -msgstr "" - -#: mural/templates/mural/list.html:19 -msgid "Per Subject" -msgstr "" - -#: mural/templates/mural/list.html:32 -msgid "Wish to make a new post?" -msgstr "" - -#: mural/templates/mural/list.html:50 -msgid "There are no posts in this mural yet." -msgstr "" - -#: mural/templates/mural/list.html:54 mural/templates/mural/list.html:67 -msgid "Filter" -msgstr "" - -#: mural/templates/mural/list.html:59 -msgid "Favorite posts" -msgstr "" - -#: mural/templates/mural/list.html:64 -msgid "Only my posts" -msgstr "" - -#: mural/templates/mural/list.html:68 -msgid "Clean Filters" -msgstr "" - -#: mural/templatetags/mural_filters.py:11 -msgid "(Edited)" -msgstr "" - -#: mural/templatetags/mural_filters.py:29 mural/views.py:231 -msgid "Unfavorite" -msgstr "" - -#: mural/templatetags/mural_filters.py:31 mural/views.py:235 -msgid "Favorite" -msgstr "" - -#: mural/views.py:71 -msgid "Mural" -msgstr "" - -#: mural/views.py:115 mural/views.py:267 -#, python-format -msgid "%s has made a post in General" -msgstr "" - -#: mural/views.py:212 -msgid "Your post was published successfully!" -msgstr "" - -#: mural/views.py:214 -msgid "Your post was edited successfully!" -msgstr "" - -#: mural/views.py:221 -msgid "Post deleted successfully!" -msgstr "" - -#: mural/views.py:299 -msgid "Your comment was published successfully!" -msgstr "" - -#: mural/views.py:301 -msgid "Your comment was edited successfully!" -msgstr "" diff --git a/mural/locale/pt_BR/LC_MESSAGES/django.po b/mural/locale/pt_BR/LC_MESSAGES/django.po index b4a70ed..f2a548b 100644 --- a/mural/locale/pt_BR/LC_MESSAGES/django.po +++ b/mural/locale/pt_BR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-03-28 22:35-0300\n" +"POT-Creation-Date: 2017-03-29 17:22-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,357 +18,340 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: mural/forms.py:21 mural/forms.py:104 +#: forms.py:18 +#| msgid "Comment" +msgctxt "form" +msgid "Comment" +msgstr "Comentar" + +#: forms.py:18 +#| msgctxt "modal" +#| msgid "Ask for Help" +msgctxt "form" +msgid "Ask for Help" +msgstr "Pedir ajuda" + +#: forms.py:26 forms.py:111 msgid "This field is required." msgstr "Esse campo é obrigatório." -#: mural/forms.py:33 mural/forms.py:116 +#: forms.py:38 forms.py:123 msgid "The image is too large. It should have less than 5MB." msgstr "A imagem é muito grande. Ela deve possuir 5MB ou menos." -#: mural/forms.py:75 +#: forms.py:82 msgid "Choose an especific resource" msgstr "Escolha um recurso específico" -#: mural/models.py:18 +#: models.py:18 msgid "File not supported." msgstr "Arquivo não suportado." -#: mural/models.py:21 +#: models.py:21 msgid "Action" msgstr "Ação" -#: mural/models.py:21 mural/models.py:105 mural/models.py:119 -#: mural/templates/mural/_form_comment.html:66 -#: mural/templates/mural/_view_comment.html:14 +#: models.py:21 +msgctxt "modal" msgid "Comment" -msgstr "Comentar" +msgstr "Comentou" -#: mural/models.py:21 +#: models.py:21 +msgctxt "modal" msgid "Ask for Help" -msgstr "Pedir ajuda" +msgstr "Pediu ajuda" -#: mural/models.py:22 mural/models.py:107 mural/models.py:118 -#: mural/models.py:127 +#: models.py:22 models.py:107 models.py:118 models.py:127 msgid "Post" msgstr "Postagem" -#: mural/models.py:23 mural/models.py:106 +#: models.py:23 models.py:106 msgid "Image" msgstr "Imagem" -#: mural/models.py:24 mural/models.py:108 mural/models.py:120 -#: mural/models.py:128 +#: models.py:24 models.py:108 models.py:120 models.py:128 msgid "User" msgstr "Usuário" -#: mural/models.py:25 mural/models.py:109 +#: models.py:25 models.py:109 msgid "Create Date" msgstr "Data de criação" -#: mural/models.py:26 mural/models.py:110 +#: models.py:26 models.py:110 msgid "Last Update" msgstr "Última atualização" -#: mural/models.py:27 mural/models.py:111 +#: models.py:27 models.py:111 msgid "Edited" msgstr "Editado" -#: mural/models.py:50 +#: models.py:50 msgid "Space" msgstr "Espaço" -#: mural/models.py:86 +#: models.py:86 msgid "Subject" msgstr "Assunto" -#: mural/models.py:87 +#: models.py:87 msgid "Resource" msgstr "Recurso" -#: mural/models.py:117 +#: models.py:105 models.py:119 templates/mural/_form_comment.html:66 +msgid "Comment" +msgstr "Comentar" + +#: models.py:117 msgid "Viewed" msgstr "Visualizado" -#: mural/models.py:121 +#: models.py:121 msgid "Date/Time Viewed" msgstr "" -#: mural/templates/mural/_form.html:76 -#: mural/templates/mural/_form_comment.html:42 -#, fuzzy -#| msgid "Click or drop the file here" +#: templates/mural/_form.html:76 templates/mural/_form_comment.html:42 msgid "Click or drop the picture here" msgstr "Clique ou solte a imagem aqui" -#: mural/templates/mural/_form.html:78 -#: mural/templates/mural/_form_comment.html:44 -#, fuzzy -#| msgid "The file could not exceed 5MB." +#: templates/mural/_form.html:78 templates/mural/_form_comment.html:44 msgid "The picture could not exceed 5MB." msgstr "A imagem não pode exceder 5MB." -#: mural/templates/mural/_form.html:100 -#, fuzzy -#| msgid "Post" +#: templates/mural/_form.html:100 msgctxt "button" msgid "Post" msgstr "Postar" -#: mural/templates/mural/_form.html:101 -#: mural/templates/mural/_form_comment.html:67 -#: mural/templates/mural/_form_comment.html:85 +#: templates/mural/_form.html:101 templates/mural/_form_comment.html:67 +#: templates/mural/_form_comment.html:85 msgid "Cancel" msgstr "Cancelar" -#: mural/templates/mural/_form_comment.html:33 +#: templates/mural/_form_comment.html:33 msgid "Choose your photo..." msgstr "Escolha sua foto..." -#: mural/templates/mural/_form_comment.html:78 +#: templates/mural/_form_comment.html:78 msgid "Insert here the name of the user you wish to mark in this comment" msgstr "Insira aqui o nome do usuário que você quer marcar nesse comentário" -#: mural/templates/mural/_form_comment.html:84 +#: templates/mural/_form_comment.html:84 msgid "Mark" msgstr "Marcar" -#: mural/templates/mural/_form_comment.html:100 +#: templates/mural/_form_comment.html:100 msgid "Mark User" msgstr "Marcar Usuário" -#: mural/templates/mural/_user_suggestions_list.html:16 +#: templates/mural/_user_suggestions_list.html:16 msgid "No results found." msgstr "Nenhum resultado encontrado." -#: mural/templates/mural/_view.html:22 -#: mural/templates/mural/_view_comment.html:22 -#: mural/templates/mural/list_category.html:59 -#: mural/templates/mural/list_subject.html:58 -#: mural/templates/mural/subject_view.html:39 +#: templates/mural/_view.html:22 templates/mural/_view_comment.html:22 +#: templates/mural/list_category.html:59 templates/mural/list_subject.html:58 +#: templates/mural/subject_view.html:39 msgid "Edit" msgstr "Editar" -#: mural/templates/mural/_view.html:24 -#: mural/templates/mural/_view_comment.html:24 -#: mural/templates/mural/list_category.html:61 -#: mural/templates/mural/list_subject.html:60 -#: mural/templates/mural/subject_view.html:41 +#: templates/mural/_view.html:24 templates/mural/_view_comment.html:24 +#: templates/mural/list_category.html:61 templates/mural/list_subject.html:60 +#: templates/mural/subject_view.html:41 msgid "Remove" msgstr "Remover" -#: mural/templates/mural/_view.html:36 -#: mural/templates/mural/_view_comment.html:31 +#: templates/mural/_view.html:36 templates/mural/_view_comment.html:31 msgid "In" msgstr "Em" -#: mural/templates/mural/_view.html:47 +#: templates/mural/_view.html:47 msgid "See complete post" msgstr "Ver postagem completa" -#: mural/templates/mural/_view.html:50 +#: templates/mural/_view.html:50 msgid "See more comments..." msgstr "Ver mais comentários..." -#: mural/templates/mural/_view.html:61 +#: templates/mural/_view.html:61 msgid "Make a comment..." msgstr "Faça um comentário..." -#: mural/templates/mural/delete.html:13 +#: templates/mural/_view_comment.html:14 +#| msgid "Comment" +msgctxt "view" +msgid "Comment" +msgstr "Comentou" + +#: templates/mural/delete.html:13 msgid "Close" msgstr "Fechar" -#: mural/templates/mural/delete.html:16 +#: templates/mural/delete.html:16 msgid "Delete" msgstr "Deletar" -#: mural/templates/mural/list.html:9 +#: templates/mural/list.html:9 msgid "Mural: General" msgstr "Mural: Geral" -#: mural/templates/mural/list.html:17 -#: mural/templates/mural/list_category.html:19 -#: mural/templates/mural/list_subject.html:19 +#: templates/mural/list.html:17 templates/mural/list_category.html:19 +#: templates/mural/list_subject.html:19 msgid "General" msgstr "Geral" -#: mural/templates/mural/list.html:18 -#: mural/templates/mural/list_category.html:20 -#: mural/templates/mural/list_subject.html:20 +#: templates/mural/list.html:18 templates/mural/list_category.html:20 +#: templates/mural/list_subject.html:20 msgid "Per Category" msgstr "Por Categoria" -#: mural/templates/mural/list.html:19 -#: mural/templates/mural/list_category.html:21 -#: mural/templates/mural/list_subject.html:21 +#: templates/mural/list.html:19 templates/mural/list_category.html:21 +#: templates/mural/list_subject.html:21 msgid "Per Subject" msgstr "Por Assunto" -#: mural/templates/mural/list.html:26 mural/templates/mural/list.html:39 -#: mural/templates/mural/list.html:74 mural/templates/mural/list.html:87 -#: mural/templates/mural/list_category.html:75 -#: mural/templates/mural/list_category.html:88 -#: mural/templates/mural/list_category.html:126 -#: mural/templates/mural/list_category.html:139 -#: mural/templates/mural/list_subject.html:74 -#: mural/templates/mural/list_subject.html:87 -#: mural/templates/mural/list_subject.html:125 -#: mural/templates/mural/list_subject.html:138 -#: mural/templates/mural/resource_view.html:73 -#: mural/templates/mural/resource_view.html:86 -#: mural/templates/mural/subject_view.html:85 -#: mural/templates/mural/subject_view.html:98 +#: templates/mural/list.html:26 templates/mural/list.html:39 +#: templates/mural/list.html:74 templates/mural/list.html:87 +#: templates/mural/list_category.html:75 templates/mural/list_category.html:88 +#: templates/mural/list_category.html:126 +#: templates/mural/list_category.html:139 templates/mural/list_subject.html:74 +#: templates/mural/list_subject.html:87 templates/mural/list_subject.html:125 +#: templates/mural/list_subject.html:138 templates/mural/resource_view.html:73 +#: templates/mural/resource_view.html:86 templates/mural/subject_view.html:85 +#: templates/mural/subject_view.html:98 msgid "Filter" msgstr "Filtrar" -#: mural/templates/mural/list.html:31 mural/templates/mural/list.html:79 -#: mural/templates/mural/list_category.html:80 -#: mural/templates/mural/list_category.html:131 -#: mural/templates/mural/list_subject.html:79 -#: mural/templates/mural/list_subject.html:130 -#: mural/templates/mural/resource_view.html:78 -#: mural/templates/mural/subject_view.html:90 +#: templates/mural/list.html:31 templates/mural/list.html:79 +#: templates/mural/list_category.html:80 templates/mural/list_category.html:131 +#: templates/mural/list_subject.html:79 templates/mural/list_subject.html:130 +#: templates/mural/resource_view.html:78 templates/mural/subject_view.html:90 msgid "Favorite posts" msgstr "Postagens favoritas" -#: mural/templates/mural/list.html:36 mural/templates/mural/list.html:84 -#: mural/templates/mural/list_category.html:85 -#: mural/templates/mural/list_category.html:136 -#: mural/templates/mural/list_subject.html:84 -#: mural/templates/mural/list_subject.html:135 -#: mural/templates/mural/resource_view.html:83 -#: mural/templates/mural/subject_view.html:95 +#: templates/mural/list.html:36 templates/mural/list.html:84 +#: templates/mural/list_category.html:85 templates/mural/list_category.html:136 +#: templates/mural/list_subject.html:84 templates/mural/list_subject.html:135 +#: templates/mural/resource_view.html:83 templates/mural/subject_view.html:95 msgid "Only my posts" msgstr "Apenas minhas postagens" -#: mural/templates/mural/list.html:40 mural/templates/mural/list.html:88 -#: mural/templates/mural/list_category.html:89 -#: mural/templates/mural/list_category.html:140 -#: mural/templates/mural/list_subject.html:88 -#: mural/templates/mural/list_subject.html:139 -#: mural/templates/mural/resource_view.html:87 -#: mural/templates/mural/subject_view.html:99 +#: templates/mural/list.html:40 templates/mural/list.html:88 +#: templates/mural/list_category.html:89 templates/mural/list_category.html:140 +#: templates/mural/list_subject.html:88 templates/mural/list_subject.html:139 +#: templates/mural/resource_view.html:87 templates/mural/subject_view.html:99 msgid "Clean Filters" msgstr "Limpar Filtros" -#: mural/templates/mural/list.html:52 -#: mural/templates/mural/list_category.html:101 -#: mural/templates/mural/list_subject.html:100 -#: mural/templates/mural/resource_view.html:51 -#: mural/templates/mural/subject_view.html:63 +#: templates/mural/list.html:52 templates/mural/list_category.html:101 +#: templates/mural/list_subject.html:100 templates/mural/resource_view.html:51 +#: templates/mural/subject_view.html:63 msgid "Wish to make a new post?" msgstr "Deseja fazer uma nova postagem?" -#: mural/templates/mural/list.html:70 -#: mural/templates/mural/list_category.html:122 -#: mural/templates/mural/list_subject.html:121 -#: mural/templates/mural/resource_view.html:69 -#: mural/templates/mural/subject_view.html:81 +#: templates/mural/list.html:70 templates/mural/list_category.html:122 +#: templates/mural/list_subject.html:121 templates/mural/resource_view.html:69 +#: templates/mural/subject_view.html:81 msgid "There are no posts in this mural yet." msgstr "Ainda não existe nenhuma postagem nesse mural." -#: mural/templates/mural/list_category.html:9 +#: templates/mural/list_category.html:9 msgid "Mural: Per Category" msgstr "Mural: Por Categoria" -#: mural/templates/mural/list_category.html:57 -#: mural/templates/mural/list_subject.html:56 -#: mural/templates/mural/subject_view.html:37 +#: templates/mural/list_category.html:57 templates/mural/list_subject.html:56 +#: templates/mural/subject_view.html:37 msgid "Replicate" msgstr "Replicar" -#: mural/templates/mural/list_category.html:111 -#: mural/templates/mural/list_subject.html:110 +#: templates/mural/list_category.html:111 templates/mural/list_subject.html:110 msgid "See more posts" msgstr "Ver mais postagens" -#: mural/templates/mural/list_subject.html:9 +#: templates/mural/list_subject.html:9 msgid "Mural: Per Subject" msgstr "Mural: Por Assunto" -#: mural/templates/mural/list_subject.html:59 -#: mural/templates/mural/subject_view.html:40 +#: templates/mural/list_subject.html:59 templates/mural/subject_view.html:40 msgid "Groups" msgstr "Grupos" -#: mural/templates/mural/resource_view.html:12 -#: mural/templates/mural/subject_view.html:9 mural/views.py:101 +#: templates/mural/resource_view.html:12 templates/mural/subject_view.html:9 +#: views.py:101 msgid "Mural" msgstr "Mural" -#: mural/templatetags/mural_filters.py:12 +#: templatetags/mural_filters.py:12 msgid "(Edited)" msgstr "(Editado)" -#: mural/templatetags/mural_filters.py:30 mural/views.py:1226 +#: templatetags/mural_filters.py:30 views.py:1226 msgid "Unfavorite" msgstr "Desfavoritar" -#: mural/templatetags/mural_filters.py:32 mural/views.py:1230 +#: templatetags/mural_filters.py:32 views.py:1230 msgid "Favorite" msgstr "Favoritar" -#: mural/templatetags/mural_filters.py:106 +#: templatetags/mural_filters.py:106 msgid "about" msgstr "sobre" -#: mural/views.py:154 +#: views.py:154 #, python-format msgid "%s has made a post in General" msgstr "%s postou em Geral" -#: mural/views.py:258 mural/views.py:522 mural/views.py:858 +#: views.py:258 views.py:522 views.py:858 msgid "Are you sure you want to delete this post?" msgstr "Você tem certeza que deseja deletar essa postagem?" -#: mural/views.py:366 +#: views.py:366 msgid "Mural - Per Category" msgstr "Mural - Por Categoria" -#: mural/views.py:411 mural/views.py:717 mural/views.py:1152 +#: views.py:411 views.py:717 views.py:1152 #, python-format msgid "%s has made a post in %s" msgstr "%s postou em %s" -#: mural/views.py:655 +#: views.py:655 msgid "Mural - Per Subject" msgstr "Mural - Por Assunto" -#: mural/views.py:969 mural/views.py:1085 +#: views.py:969 views.py:1085 #, python-format msgid "%s - Mural" msgstr "%s - Mural" -#: mural/views.py:1207 +#: views.py:1207 msgid "Your post was published successfully!" msgstr "Sua postagem foi publicada com sucesso!" -#: mural/views.py:1209 +#: views.py:1209 msgid "Your post was edited successfully!" msgstr "Sua postagem foi editada com sucesso!" -#: mural/views.py:1216 +#: views.py:1216 msgid "Post deleted successfully!" msgstr "Postagem deletada com sucesso!" -#: mural/views.py:1284 +#: views.py:1284 #, python-format msgid "%s has commented in a post" msgstr "%s comentou em um postagem" -#: mural/views.py:1443 +#: views.py:1443 msgid "Are you sure you want to delete this comment?" msgstr "Você tem certeza que deseja deletar esse comentário?" -#: mural/views.py:1510 +#: views.py:1510 msgid "Your comment was published successfully!" msgstr "Seu comentário foi publicado com sucesso!" -#: mural/views.py:1512 +#: views.py:1512 msgid "Your comment was edited successfully!" msgstr "Seu comentário foi editado com sucesso!" -#: mural/views.py:1519 +#: views.py:1519 msgid "Comment deleted successfully!" msgstr "Comentário deletado com sucesso!" diff --git a/mural/models.py b/mural/models.py index 2e26b14..bc0994a 100644 --- a/mural/models.py +++ b/mural/models.py @@ -1,7 +1,7 @@ from django.db import models from django.core import validators from django.core.exceptions import ValidationError -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _, pgettext_lazy from topics.decorators import always_as_child @@ -12,13 +12,13 @@ from users.models import User def validate_img_extension(value): valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png'] - + if hasattr(value.file, 'content_type'): if not value.file.content_type in valid_formats: raise ValidationError(_('File not supported.')) class Mural(KnowsChild): - action = models.CharField(_('Action'), max_length = 100, default = "comment", choices = (("comment", _("Comment")), ("help", _("Ask for Help")))) + action = models.CharField(_('Action'), max_length = 100, default = "comment", choices = (("comment", pgettext_lazy("modal","Comment")), ("help", pgettext_lazy("modal","Ask for Help")))) post = models.TextField(_('Post'), blank = True) image = models.ImageField(verbose_name = _('Image'), null=True, blank = True, upload_to = 'posts/', validators = [validate_img_extension]) user = models.ForeignKey(User, verbose_name = _('User'), related_name = "post_user", null = True) @@ -125,4 +125,4 @@ class MuralVisualizations(models.Model): """ class MuralFavorites(models.Model): post = models.ForeignKey(Mural, verbose_name = _('Post'), related_name = 'favorites_post', null = True) - user = models.ForeignKey(User, verbose_name = _('User'), related_name = "favorites_user", null = True) \ No newline at end of file + user = models.ForeignKey(User, verbose_name = _('User'), related_name = "favorites_user", null = True) diff --git a/mural/templates/mural/_view_comment.html b/mural/templates/mural/_view_comment.html index 00c6c3c..21f8d57 100644 --- a/mural/templates/mural/_view_comment.html +++ b/mural/templates/mural/_view_comment.html @@ -11,7 +11,7 @@ {{ comment.user }} - {% trans 'Comment' %} + {% trans 'Comment' context "view" %} {% if comment|show_settings_comment:request.user %} @@ -39,4 +39,4 @@ {% endif %} - \ No newline at end of file + -- libgit2 0.21.2