Commit 7134e6991e84c566425cfa941c0dfdca29c811b9

Authored by Jailson Dias
1 parent 646fcd8b

Resolvendo problemas de texto nos modais do mural

mural/forms.py
1 # coding=utf-8 1 # coding=utf-8
2 from django import forms 2 from django import forms
3 -from django.utils.translation import ugettext_lazy as _ 3 +from django.utils.translation import ugettext_lazy as _, pgettext_lazy
4 from django.utils.html import strip_tags 4 from django.utils.html import strip_tags
5 from django.db.models import Q 5 from django.db.models import Q
6 6
@@ -13,6 +13,11 @@ from .models import GeneralPost, CategoryPost, SubjectPost, Comment @@ -13,6 +13,11 @@ from .models import GeneralPost, CategoryPost, SubjectPost, Comment
13 class Validation(forms.ModelForm): 13 class Validation(forms.ModelForm):
14 MAX_UPLOAD_SIZE = 5*1024*1024 14 MAX_UPLOAD_SIZE = 5*1024*1024
15 15
  16 + def __init__(self, *args, **kwargs):
  17 + super(Validation, self).__init__(*args, **kwargs)
  18 + CHOICES = (("comment", pgettext_lazy("form","Comment")), ("help", pgettext_lazy("form","Ask for Help")))
  19 + self.fields['action'].choices = CHOICES
  20 +
16 def clean_post(self): 21 def clean_post(self):
17 post = self.cleaned_data.get('post', '') 22 post = self.cleaned_data.get('post', '')
18 cleaned_post = strip_tags(post) 23 cleaned_post = strip_tags(post)
@@ -38,9 +43,11 @@ class Validation(forms.ModelForm): @@ -38,9 +43,11 @@ class Validation(forms.ModelForm):
38 43
39 44
40 class GeneralPostForm(Validation): 45 class GeneralPostForm(Validation):
  46 +
41 class Meta: 47 class Meta:
42 model = GeneralPost 48 model = GeneralPost
43 fields = ['action', 'post', 'image'] 49 fields = ['action', 'post', 'image']
  50 +
44 widgets = { 51 widgets = {
45 'action': forms.RadioSelect, 52 'action': forms.RadioSelect,
46 'post': forms.Textarea, 53 'post': forms.Textarea,
mural/locale/pt-br/LC_MESSAGES/django.po
@@ -1,241 +0,0 @@ @@ -1,241 +0,0 @@
1 -# SOME DESCRIPTIVE TITLE.  
2 -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER  
3 -# This file is distributed under the same license as the PACKAGE package.  
4 -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.  
5 -#  
6 -#, fuzzy  
7 -msgid ""  
8 -msgstr ""  
9 -"Project-Id-Version: PACKAGE VERSION\n"  
10 -"Report-Msgid-Bugs-To: \n"  
11 -"POT-Creation-Date: 2017-02-09 18:40-0300\n"  
12 -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"  
13 -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"  
14 -"Language-Team: LANGUAGE <LL@li.org>\n"  
15 -"Language: \n"  
16 -"MIME-Version: 1.0\n"  
17 -"Content-Type: text/plain; charset=UTF-8\n"  
18 -"Content-Transfer-Encoding: 8bit\n"  
19 -  
20 -#: mural/forms.py:16 mural/forms.py:51  
21 -msgid "This field is required."  
22 -msgstr ""  
23 -  
24 -#: mural/forms.py:28 mural/forms.py:63  
25 -msgid "The image is too large. It should have less than 5MB."  
26 -msgstr ""  
27 -  
28 -#: mural/models.py:18  
29 -msgid "File not supported."  
30 -msgstr ""  
31 -  
32 -#: mural/models.py:21  
33 -msgid "Action"  
34 -msgstr ""  
35 -  
36 -#: mural/models.py:21 mural/models.py:66 mural/models.py:79  
37 -#: mural/templates/mural/_view_comment.html:14  
38 -msgid "Comment"  
39 -msgstr ""  
40 -  
41 -#: mural/models.py:21  
42 -msgid "Ask for Help"  
43 -msgstr ""  
44 -  
45 -#: mural/models.py:22 mural/models.py:68 mural/models.py:78 mural/models.py:86  
46 -msgid "Post"  
47 -msgstr ""  
48 -  
49 -#: mural/models.py:23 mural/models.py:67  
50 -msgid "Image"  
51 -msgstr ""  
52 -  
53 -#: mural/models.py:24 mural/models.py:69 mural/models.py:80 mural/models.py:87  
54 -msgid "User"  
55 -msgstr ""  
56 -  
57 -#: mural/models.py:25 mural/models.py:70  
58 -msgid "Create Date"  
59 -msgstr ""  
60 -  
61 -#: mural/models.py:26 mural/models.py:71  
62 -msgid "Last Update"  
63 -msgstr ""  
64 -  
65 -#: mural/models.py:27  
66 -msgid "Edited"  
67 -msgstr ""  
68 -  
69 -#: mural/models.py:38  
70 -msgid "Space"  
71 -msgstr ""  
72 -  
73 -#: mural/models.py:56  
74 -msgid "Subject"  
75 -msgstr ""  
76 -  
77 -#: mural/models.py:57  
78 -msgid "Resource"  
79 -msgstr ""  
80 -  
81 -#: mural/models.py:77  
82 -msgid "Viewed"  
83 -msgstr ""  
84 -  
85 -#: mural/templates/mural/_form.html:54  
86 -#: mural/templates/mural/_form_comment.html:33  
87 -msgid "Choose your photo..."  
88 -msgstr ""  
89 -  
90 -#: mural/templates/mural/_form.html:63  
91 -#: mural/templates/mural/_form_comment.html:42  
92 -msgid "Click or drop the file here"  
93 -msgstr ""  
94 -  
95 -#: mural/templates/mural/_form.html:65  
96 -#: mural/templates/mural/_form_comment.html:44  
97 -msgid "The file could not exceed 5MB."  
98 -msgstr ""  
99 -  
100 -#: mural/templates/mural/_form.html:87  
101 -#: mural/templates/mural/_form_comment.html:66  
102 -msgid "Save"  
103 -msgstr ""  
104 -  
105 -#: mural/templates/mural/_form.html:88  
106 -#: mural/templates/mural/_form_comment.html:67  
107 -#: mural/templates/mural/_form_comment.html:91  
108 -msgid "Cancel"  
109 -msgstr ""  
110 -  
111 -#: mural/templates/mural/_form_comment.html:77  
112 -msgid "Mark user in comment"  
113 -msgstr ""  
114 -  
115 -#: mural/templates/mural/_form_comment.html:80  
116 -msgid "Type the user name in the field below"  
117 -msgstr ""  
118 -  
119 -#: mural/templates/mural/_form_comment.html:90  
120 -msgid "Mark"  
121 -msgstr ""  
122 -  
123 -#: mural/templates/mural/_form_comment.html:106  
124 -msgid "Mark User"  
125 -msgstr ""  
126 -  
127 -#: mural/templates/mural/_user_suggestions_list.html:16  
128 -msgid "No results found."  
129 -msgstr ""  
130 -  
131 -#: mural/templates/mural/_view.html:21  
132 -#: mural/templates/mural/_view_comment.html:22  
133 -msgid "Edit"  
134 -msgstr ""  
135 -  
136 -#: mural/templates/mural/_view.html:23  
137 -#: mural/templates/mural/_view_comment.html:24  
138 -msgid "Remove"  
139 -msgstr ""  
140 -  
141 -#: mural/templates/mural/_view.html:35  
142 -#: mural/templates/mural/_view_comment.html:31  
143 -msgid "In"  
144 -msgstr ""  
145 -  
146 -#: mural/templates/mural/_view.html:59  
147 -msgid "Make a comment..."  
148 -msgstr ""  
149 -  
150 -#: mural/templates/mural/delete.html:8  
151 -msgid "Are you sure you want to delete this post"  
152 -msgstr ""  
153 -  
154 -#: mural/templates/mural/delete.html:13  
155 -msgid "Close"  
156 -msgstr ""  
157 -  
158 -#: mural/templates/mural/delete.html:16  
159 -msgid "Delete"  
160 -msgstr ""  
161 -  
162 -#: mural/templates/mural/list.html:9  
163 -msgid "Mural: General"  
164 -msgstr ""  
165 -  
166 -#: mural/templates/mural/list.html:17  
167 -msgid "General"  
168 -msgstr ""  
169 -  
170 -#: mural/templates/mural/list.html:18  
171 -msgid "Per Category"  
172 -msgstr ""  
173 -  
174 -#: mural/templates/mural/list.html:19  
175 -msgid "Per Subject"  
176 -msgstr ""  
177 -  
178 -#: mural/templates/mural/list.html:32  
179 -msgid "Wish to make a new post?"  
180 -msgstr ""  
181 -  
182 -#: mural/templates/mural/list.html:50  
183 -msgid "There are no posts in this mural yet."  
184 -msgstr ""  
185 -  
186 -#: mural/templates/mural/list.html:54 mural/templates/mural/list.html:67  
187 -msgid "Filter"  
188 -msgstr ""  
189 -  
190 -#: mural/templates/mural/list.html:59  
191 -msgid "Favorite posts"  
192 -msgstr ""  
193 -  
194 -#: mural/templates/mural/list.html:64  
195 -msgid "Only my posts"  
196 -msgstr ""  
197 -  
198 -#: mural/templates/mural/list.html:68  
199 -msgid "Clean Filters"  
200 -msgstr ""  
201 -  
202 -#: mural/templatetags/mural_filters.py:11  
203 -msgid "(Edited)"  
204 -msgstr ""  
205 -  
206 -#: mural/templatetags/mural_filters.py:29 mural/views.py:231  
207 -msgid "Unfavorite"  
208 -msgstr ""  
209 -  
210 -#: mural/templatetags/mural_filters.py:31 mural/views.py:235  
211 -msgid "Favorite"  
212 -msgstr ""  
213 -  
214 -#: mural/views.py:71  
215 -msgid "Mural"  
216 -msgstr ""  
217 -  
218 -#: mural/views.py:115 mural/views.py:267  
219 -#, python-format  
220 -msgid "%s has made a post in General"  
221 -msgstr ""  
222 -  
223 -#: mural/views.py:212  
224 -msgid "Your post was published successfully!"  
225 -msgstr ""  
226 -  
227 -#: mural/views.py:214  
228 -msgid "Your post was edited successfully!"  
229 -msgstr ""  
230 -  
231 -#: mural/views.py:221  
232 -msgid "Post deleted successfully!"  
233 -msgstr ""  
234 -  
235 -#: mural/views.py:299  
236 -msgid "Your comment was published successfully!"  
237 -msgstr ""  
238 -  
239 -#: mural/views.py:301  
240 -msgid "Your comment was edited successfully!"  
241 -msgstr ""  
mural/locale/pt_BR/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid &quot;&quot; @@ -8,7 +8,7 @@ msgid &quot;&quot;
8 msgstr "" 8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n" 9 "Project-Id-Version: PACKAGE VERSION\n"
10 "Report-Msgid-Bugs-To: \n" 10 "Report-Msgid-Bugs-To: \n"
11 -"POT-Creation-Date: 2017-03-28 22:35-0300\n" 11 +"POT-Creation-Date: 2017-03-29 17:22-0300\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -18,357 +18,340 @@ msgstr &quot;&quot; @@ -18,357 +18,340 @@ msgstr &quot;&quot;
18 "Content-Transfer-Encoding: 8bit\n" 18 "Content-Transfer-Encoding: 8bit\n"
19 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 19 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
20 20
21 -#: mural/forms.py:21 mural/forms.py:104 21 +#: forms.py:18
  22 +#| msgid "Comment"
  23 +msgctxt "form"
  24 +msgid "Comment"
  25 +msgstr "Comentar"
  26 +
  27 +#: forms.py:18
  28 +#| msgctxt "modal"
  29 +#| msgid "Ask for Help"
  30 +msgctxt "form"
  31 +msgid "Ask for Help"
  32 +msgstr "Pedir ajuda"
  33 +
  34 +#: forms.py:26 forms.py:111
22 msgid "This field is required." 35 msgid "This field is required."
23 msgstr "Esse campo é obrigatório." 36 msgstr "Esse campo é obrigatório."
24 37
25 -#: mural/forms.py:33 mural/forms.py:116 38 +#: forms.py:38 forms.py:123
26 msgid "The image is too large. It should have less than 5MB." 39 msgid "The image is too large. It should have less than 5MB."
27 msgstr "A imagem é muito grande. Ela deve possuir 5MB ou menos." 40 msgstr "A imagem é muito grande. Ela deve possuir 5MB ou menos."
28 41
29 -#: mural/forms.py:75 42 +#: forms.py:82
30 msgid "Choose an especific resource" 43 msgid "Choose an especific resource"
31 msgstr "Escolha um recurso específico" 44 msgstr "Escolha um recurso específico"
32 45
33 -#: mural/models.py:18 46 +#: models.py:18
34 msgid "File not supported." 47 msgid "File not supported."
35 msgstr "Arquivo não suportado." 48 msgstr "Arquivo não suportado."
36 49
37 -#: mural/models.py:21 50 +#: models.py:21
38 msgid "Action" 51 msgid "Action"
39 msgstr "Ação" 52 msgstr "Ação"
40 53
41 -#: mural/models.py:21 mural/models.py:105 mural/models.py:119  
42 -#: mural/templates/mural/_form_comment.html:66  
43 -#: mural/templates/mural/_view_comment.html:14 54 +#: models.py:21
  55 +msgctxt "modal"
44 msgid "Comment" 56 msgid "Comment"
45 -msgstr "Comentar" 57 +msgstr "Comentou"
46 58
47 -#: mural/models.py:21 59 +#: models.py:21
  60 +msgctxt "modal"
48 msgid "Ask for Help" 61 msgid "Ask for Help"
49 -msgstr "Pedir ajuda" 62 +msgstr "Pediu ajuda"
50 63
51 -#: mural/models.py:22 mural/models.py:107 mural/models.py:118  
52 -#: mural/models.py:127 64 +#: models.py:22 models.py:107 models.py:118 models.py:127
53 msgid "Post" 65 msgid "Post"
54 msgstr "Postagem" 66 msgstr "Postagem"
55 67
56 -#: mural/models.py:23 mural/models.py:106 68 +#: models.py:23 models.py:106
57 msgid "Image" 69 msgid "Image"
58 msgstr "Imagem" 70 msgstr "Imagem"
59 71
60 -#: mural/models.py:24 mural/models.py:108 mural/models.py:120  
61 -#: mural/models.py:128 72 +#: models.py:24 models.py:108 models.py:120 models.py:128
62 msgid "User" 73 msgid "User"
63 msgstr "Usuário" 74 msgstr "Usuário"
64 75
65 -#: mural/models.py:25 mural/models.py:109 76 +#: models.py:25 models.py:109
66 msgid "Create Date" 77 msgid "Create Date"
67 msgstr "Data de criação" 78 msgstr "Data de criação"
68 79
69 -#: mural/models.py:26 mural/models.py:110 80 +#: models.py:26 models.py:110
70 msgid "Last Update" 81 msgid "Last Update"
71 msgstr "Última atualização" 82 msgstr "Última atualização"
72 83
73 -#: mural/models.py:27 mural/models.py:111 84 +#: models.py:27 models.py:111
74 msgid "Edited" 85 msgid "Edited"
75 msgstr "Editado" 86 msgstr "Editado"
76 87
77 -#: mural/models.py:50 88 +#: models.py:50
78 msgid "Space" 89 msgid "Space"
79 msgstr "Espaço" 90 msgstr "Espaço"
80 91
81 -#: mural/models.py:86 92 +#: models.py:86
82 msgid "Subject" 93 msgid "Subject"
83 msgstr "Assunto" 94 msgstr "Assunto"
84 95
85 -#: mural/models.py:87 96 +#: models.py:87
86 msgid "Resource" 97 msgid "Resource"
87 msgstr "Recurso" 98 msgstr "Recurso"
88 99
89 -#: mural/models.py:117 100 +#: models.py:105 models.py:119 templates/mural/_form_comment.html:66
  101 +msgid "Comment"
  102 +msgstr "Comentar"
  103 +
  104 +#: models.py:117
90 msgid "Viewed" 105 msgid "Viewed"
91 msgstr "Visualizado" 106 msgstr "Visualizado"
92 107
93 -#: mural/models.py:121 108 +#: models.py:121
94 msgid "Date/Time Viewed" 109 msgid "Date/Time Viewed"
95 msgstr "" 110 msgstr ""
96 111
97 -#: mural/templates/mural/_form.html:76  
98 -#: mural/templates/mural/_form_comment.html:42  
99 -#, fuzzy  
100 -#| msgid "Click or drop the file here" 112 +#: templates/mural/_form.html:76 templates/mural/_form_comment.html:42
101 msgid "Click or drop the picture here" 113 msgid "Click or drop the picture here"
102 msgstr "Clique ou solte a imagem aqui" 114 msgstr "Clique ou solte a imagem aqui"
103 115
104 -#: mural/templates/mural/_form.html:78  
105 -#: mural/templates/mural/_form_comment.html:44  
106 -#, fuzzy  
107 -#| msgid "The file could not exceed 5MB." 116 +#: templates/mural/_form.html:78 templates/mural/_form_comment.html:44
108 msgid "The picture could not exceed 5MB." 117 msgid "The picture could not exceed 5MB."
109 msgstr "A imagem não pode exceder 5MB." 118 msgstr "A imagem não pode exceder 5MB."
110 119
111 -#: mural/templates/mural/_form.html:100  
112 -#, fuzzy  
113 -#| msgid "Post" 120 +#: templates/mural/_form.html:100
114 msgctxt "button" 121 msgctxt "button"
115 msgid "Post" 122 msgid "Post"
116 msgstr "Postar" 123 msgstr "Postar"
117 124
118 -#: mural/templates/mural/_form.html:101  
119 -#: mural/templates/mural/_form_comment.html:67  
120 -#: mural/templates/mural/_form_comment.html:85 125 +#: templates/mural/_form.html:101 templates/mural/_form_comment.html:67
  126 +#: templates/mural/_form_comment.html:85
121 msgid "Cancel" 127 msgid "Cancel"
122 msgstr "Cancelar" 128 msgstr "Cancelar"
123 129
124 -#: mural/templates/mural/_form_comment.html:33 130 +#: templates/mural/_form_comment.html:33
125 msgid "Choose your photo..." 131 msgid "Choose your photo..."
126 msgstr "Escolha sua foto..." 132 msgstr "Escolha sua foto..."
127 133
128 -#: mural/templates/mural/_form_comment.html:78 134 +#: templates/mural/_form_comment.html:78
129 msgid "Insert here the name of the user you wish to mark in this comment" 135 msgid "Insert here the name of the user you wish to mark in this comment"
130 msgstr "Insira aqui o nome do usuário que você quer marcar nesse comentário" 136 msgstr "Insira aqui o nome do usuário que você quer marcar nesse comentário"
131 137
132 -#: mural/templates/mural/_form_comment.html:84 138 +#: templates/mural/_form_comment.html:84
133 msgid "Mark" 139 msgid "Mark"
134 msgstr "Marcar" 140 msgstr "Marcar"
135 141
136 -#: mural/templates/mural/_form_comment.html:100 142 +#: templates/mural/_form_comment.html:100
137 msgid "Mark User" 143 msgid "Mark User"
138 msgstr "Marcar Usuário" 144 msgstr "Marcar Usuário"
139 145
140 -#: mural/templates/mural/_user_suggestions_list.html:16 146 +#: templates/mural/_user_suggestions_list.html:16
141 msgid "No results found." 147 msgid "No results found."
142 msgstr "Nenhum resultado encontrado." 148 msgstr "Nenhum resultado encontrado."
143 149
144 -#: mural/templates/mural/_view.html:22  
145 -#: mural/templates/mural/_view_comment.html:22  
146 -#: mural/templates/mural/list_category.html:59  
147 -#: mural/templates/mural/list_subject.html:58  
148 -#: mural/templates/mural/subject_view.html:39 150 +#: templates/mural/_view.html:22 templates/mural/_view_comment.html:22
  151 +#: templates/mural/list_category.html:59 templates/mural/list_subject.html:58
  152 +#: templates/mural/subject_view.html:39
149 msgid "Edit" 153 msgid "Edit"
150 msgstr "Editar" 154 msgstr "Editar"
151 155
152 -#: mural/templates/mural/_view.html:24  
153 -#: mural/templates/mural/_view_comment.html:24  
154 -#: mural/templates/mural/list_category.html:61  
155 -#: mural/templates/mural/list_subject.html:60  
156 -#: mural/templates/mural/subject_view.html:41 156 +#: templates/mural/_view.html:24 templates/mural/_view_comment.html:24
  157 +#: templates/mural/list_category.html:61 templates/mural/list_subject.html:60
  158 +#: templates/mural/subject_view.html:41
157 msgid "Remove" 159 msgid "Remove"
158 msgstr "Remover" 160 msgstr "Remover"
159 161
160 -#: mural/templates/mural/_view.html:36  
161 -#: mural/templates/mural/_view_comment.html:31 162 +#: templates/mural/_view.html:36 templates/mural/_view_comment.html:31
162 msgid "In" 163 msgid "In"
163 msgstr "Em" 164 msgstr "Em"
164 165
165 -#: mural/templates/mural/_view.html:47 166 +#: templates/mural/_view.html:47
166 msgid "See complete post" 167 msgid "See complete post"
167 msgstr "Ver postagem completa" 168 msgstr "Ver postagem completa"
168 169
169 -#: mural/templates/mural/_view.html:50 170 +#: templates/mural/_view.html:50
170 msgid "See more comments..." 171 msgid "See more comments..."
171 msgstr "Ver mais comentários..." 172 msgstr "Ver mais comentários..."
172 173
173 -#: mural/templates/mural/_view.html:61 174 +#: templates/mural/_view.html:61
174 msgid "Make a comment..." 175 msgid "Make a comment..."
175 msgstr "Faça um comentário..." 176 msgstr "Faça um comentário..."
176 177
177 -#: mural/templates/mural/delete.html:13 178 +#: templates/mural/_view_comment.html:14
  179 +#| msgid "Comment"
  180 +msgctxt "view"
  181 +msgid "Comment"
  182 +msgstr "Comentou"
  183 +
  184 +#: templates/mural/delete.html:13
178 msgid "Close" 185 msgid "Close"
179 msgstr "Fechar" 186 msgstr "Fechar"
180 187
181 -#: mural/templates/mural/delete.html:16 188 +#: templates/mural/delete.html:16
182 msgid "Delete" 189 msgid "Delete"
183 msgstr "Deletar" 190 msgstr "Deletar"
184 191
185 -#: mural/templates/mural/list.html:9 192 +#: templates/mural/list.html:9
186 msgid "Mural: General" 193 msgid "Mural: General"
187 msgstr "Mural: Geral" 194 msgstr "Mural: Geral"
188 195
189 -#: mural/templates/mural/list.html:17  
190 -#: mural/templates/mural/list_category.html:19  
191 -#: mural/templates/mural/list_subject.html:19 196 +#: templates/mural/list.html:17 templates/mural/list_category.html:19
  197 +#: templates/mural/list_subject.html:19
192 msgid "General" 198 msgid "General"
193 msgstr "Geral" 199 msgstr "Geral"
194 200
195 -#: mural/templates/mural/list.html:18  
196 -#: mural/templates/mural/list_category.html:20  
197 -#: mural/templates/mural/list_subject.html:20 201 +#: templates/mural/list.html:18 templates/mural/list_category.html:20
  202 +#: templates/mural/list_subject.html:20
198 msgid "Per Category" 203 msgid "Per Category"
199 msgstr "Por Categoria" 204 msgstr "Por Categoria"
200 205
201 -#: mural/templates/mural/list.html:19  
202 -#: mural/templates/mural/list_category.html:21  
203 -#: mural/templates/mural/list_subject.html:21 206 +#: templates/mural/list.html:19 templates/mural/list_category.html:21
  207 +#: templates/mural/list_subject.html:21
204 msgid "Per Subject" 208 msgid "Per Subject"
205 msgstr "Por Assunto" 209 msgstr "Por Assunto"
206 210
207 -#: mural/templates/mural/list.html:26 mural/templates/mural/list.html:39  
208 -#: mural/templates/mural/list.html:74 mural/templates/mural/list.html:87  
209 -#: mural/templates/mural/list_category.html:75  
210 -#: mural/templates/mural/list_category.html:88  
211 -#: mural/templates/mural/list_category.html:126  
212 -#: mural/templates/mural/list_category.html:139  
213 -#: mural/templates/mural/list_subject.html:74  
214 -#: mural/templates/mural/list_subject.html:87  
215 -#: mural/templates/mural/list_subject.html:125  
216 -#: mural/templates/mural/list_subject.html:138  
217 -#: mural/templates/mural/resource_view.html:73  
218 -#: mural/templates/mural/resource_view.html:86  
219 -#: mural/templates/mural/subject_view.html:85  
220 -#: mural/templates/mural/subject_view.html:98 211 +#: templates/mural/list.html:26 templates/mural/list.html:39
  212 +#: templates/mural/list.html:74 templates/mural/list.html:87
  213 +#: templates/mural/list_category.html:75 templates/mural/list_category.html:88
  214 +#: templates/mural/list_category.html:126
  215 +#: templates/mural/list_category.html:139 templates/mural/list_subject.html:74
  216 +#: templates/mural/list_subject.html:87 templates/mural/list_subject.html:125
  217 +#: templates/mural/list_subject.html:138 templates/mural/resource_view.html:73
  218 +#: templates/mural/resource_view.html:86 templates/mural/subject_view.html:85
  219 +#: templates/mural/subject_view.html:98
221 msgid "Filter" 220 msgid "Filter"
222 msgstr "Filtrar" 221 msgstr "Filtrar"
223 222
224 -#: mural/templates/mural/list.html:31 mural/templates/mural/list.html:79  
225 -#: mural/templates/mural/list_category.html:80  
226 -#: mural/templates/mural/list_category.html:131  
227 -#: mural/templates/mural/list_subject.html:79  
228 -#: mural/templates/mural/list_subject.html:130  
229 -#: mural/templates/mural/resource_view.html:78  
230 -#: mural/templates/mural/subject_view.html:90 223 +#: templates/mural/list.html:31 templates/mural/list.html:79
  224 +#: templates/mural/list_category.html:80 templates/mural/list_category.html:131
  225 +#: templates/mural/list_subject.html:79 templates/mural/list_subject.html:130
  226 +#: templates/mural/resource_view.html:78 templates/mural/subject_view.html:90
231 msgid "Favorite posts" 227 msgid "Favorite posts"
232 msgstr "Postagens favoritas" 228 msgstr "Postagens favoritas"
233 229
234 -#: mural/templates/mural/list.html:36 mural/templates/mural/list.html:84  
235 -#: mural/templates/mural/list_category.html:85  
236 -#: mural/templates/mural/list_category.html:136  
237 -#: mural/templates/mural/list_subject.html:84  
238 -#: mural/templates/mural/list_subject.html:135  
239 -#: mural/templates/mural/resource_view.html:83  
240 -#: mural/templates/mural/subject_view.html:95 230 +#: templates/mural/list.html:36 templates/mural/list.html:84
  231 +#: templates/mural/list_category.html:85 templates/mural/list_category.html:136
  232 +#: templates/mural/list_subject.html:84 templates/mural/list_subject.html:135
  233 +#: templates/mural/resource_view.html:83 templates/mural/subject_view.html:95
241 msgid "Only my posts" 234 msgid "Only my posts"
242 msgstr "Apenas minhas postagens" 235 msgstr "Apenas minhas postagens"
243 236
244 -#: mural/templates/mural/list.html:40 mural/templates/mural/list.html:88  
245 -#: mural/templates/mural/list_category.html:89  
246 -#: mural/templates/mural/list_category.html:140  
247 -#: mural/templates/mural/list_subject.html:88  
248 -#: mural/templates/mural/list_subject.html:139  
249 -#: mural/templates/mural/resource_view.html:87  
250 -#: mural/templates/mural/subject_view.html:99 237 +#: templates/mural/list.html:40 templates/mural/list.html:88
  238 +#: templates/mural/list_category.html:89 templates/mural/list_category.html:140
  239 +#: templates/mural/list_subject.html:88 templates/mural/list_subject.html:139
  240 +#: templates/mural/resource_view.html:87 templates/mural/subject_view.html:99
251 msgid "Clean Filters" 241 msgid "Clean Filters"
252 msgstr "Limpar Filtros" 242 msgstr "Limpar Filtros"
253 243
254 -#: mural/templates/mural/list.html:52  
255 -#: mural/templates/mural/list_category.html:101  
256 -#: mural/templates/mural/list_subject.html:100  
257 -#: mural/templates/mural/resource_view.html:51  
258 -#: mural/templates/mural/subject_view.html:63 244 +#: templates/mural/list.html:52 templates/mural/list_category.html:101
  245 +#: templates/mural/list_subject.html:100 templates/mural/resource_view.html:51
  246 +#: templates/mural/subject_view.html:63
259 msgid "Wish to make a new post?" 247 msgid "Wish to make a new post?"
260 msgstr "Deseja fazer uma nova postagem?" 248 msgstr "Deseja fazer uma nova postagem?"
261 249
262 -#: mural/templates/mural/list.html:70  
263 -#: mural/templates/mural/list_category.html:122  
264 -#: mural/templates/mural/list_subject.html:121  
265 -#: mural/templates/mural/resource_view.html:69  
266 -#: mural/templates/mural/subject_view.html:81 250 +#: templates/mural/list.html:70 templates/mural/list_category.html:122
  251 +#: templates/mural/list_subject.html:121 templates/mural/resource_view.html:69
  252 +#: templates/mural/subject_view.html:81
267 msgid "There are no posts in this mural yet." 253 msgid "There are no posts in this mural yet."
268 msgstr "Ainda não existe nenhuma postagem nesse mural." 254 msgstr "Ainda não existe nenhuma postagem nesse mural."
269 255
270 -#: mural/templates/mural/list_category.html:9 256 +#: templates/mural/list_category.html:9
271 msgid "Mural: Per Category" 257 msgid "Mural: Per Category"
272 msgstr "Mural: Por Categoria" 258 msgstr "Mural: Por Categoria"
273 259
274 -#: mural/templates/mural/list_category.html:57  
275 -#: mural/templates/mural/list_subject.html:56  
276 -#: mural/templates/mural/subject_view.html:37 260 +#: templates/mural/list_category.html:57 templates/mural/list_subject.html:56
  261 +#: templates/mural/subject_view.html:37
277 msgid "Replicate" 262 msgid "Replicate"
278 msgstr "Replicar" 263 msgstr "Replicar"
279 264
280 -#: mural/templates/mural/list_category.html:111  
281 -#: mural/templates/mural/list_subject.html:110 265 +#: templates/mural/list_category.html:111 templates/mural/list_subject.html:110
282 msgid "See more posts" 266 msgid "See more posts"
283 msgstr "Ver mais postagens" 267 msgstr "Ver mais postagens"
284 268
285 -#: mural/templates/mural/list_subject.html:9 269 +#: templates/mural/list_subject.html:9
286 msgid "Mural: Per Subject" 270 msgid "Mural: Per Subject"
287 msgstr "Mural: Por Assunto" 271 msgstr "Mural: Por Assunto"
288 272
289 -#: mural/templates/mural/list_subject.html:59  
290 -#: mural/templates/mural/subject_view.html:40 273 +#: templates/mural/list_subject.html:59 templates/mural/subject_view.html:40
291 msgid "Groups" 274 msgid "Groups"
292 msgstr "Grupos" 275 msgstr "Grupos"
293 276
294 -#: mural/templates/mural/resource_view.html:12  
295 -#: mural/templates/mural/subject_view.html:9 mural/views.py:101 277 +#: templates/mural/resource_view.html:12 templates/mural/subject_view.html:9
  278 +#: views.py:101
296 msgid "Mural" 279 msgid "Mural"
297 msgstr "Mural" 280 msgstr "Mural"
298 281
299 -#: mural/templatetags/mural_filters.py:12 282 +#: templatetags/mural_filters.py:12
300 msgid "(Edited)" 283 msgid "(Edited)"
301 msgstr "(Editado)" 284 msgstr "(Editado)"
302 285
303 -#: mural/templatetags/mural_filters.py:30 mural/views.py:1226 286 +#: templatetags/mural_filters.py:30 views.py:1226
304 msgid "Unfavorite" 287 msgid "Unfavorite"
305 msgstr "Desfavoritar" 288 msgstr "Desfavoritar"
306 289
307 -#: mural/templatetags/mural_filters.py:32 mural/views.py:1230 290 +#: templatetags/mural_filters.py:32 views.py:1230
308 msgid "Favorite" 291 msgid "Favorite"
309 msgstr "Favoritar" 292 msgstr "Favoritar"
310 293
311 -#: mural/templatetags/mural_filters.py:106 294 +#: templatetags/mural_filters.py:106
312 msgid "about" 295 msgid "about"
313 msgstr "sobre" 296 msgstr "sobre"
314 297
315 -#: mural/views.py:154 298 +#: views.py:154
316 #, python-format 299 #, python-format
317 msgid "%s has made a post in General" 300 msgid "%s has made a post in General"
318 msgstr "%s postou em Geral" 301 msgstr "%s postou em Geral"
319 302
320 -#: mural/views.py:258 mural/views.py:522 mural/views.py:858 303 +#: views.py:258 views.py:522 views.py:858
321 msgid "Are you sure you want to delete this post?" 304 msgid "Are you sure you want to delete this post?"
322 msgstr "Você tem certeza que deseja deletar essa postagem?" 305 msgstr "Você tem certeza que deseja deletar essa postagem?"
323 306
324 -#: mural/views.py:366 307 +#: views.py:366
325 msgid "Mural - Per Category" 308 msgid "Mural - Per Category"
326 msgstr "Mural - Por Categoria" 309 msgstr "Mural - Por Categoria"
327 310
328 -#: mural/views.py:411 mural/views.py:717 mural/views.py:1152 311 +#: views.py:411 views.py:717 views.py:1152
329 #, python-format 312 #, python-format
330 msgid "%s has made a post in %s" 313 msgid "%s has made a post in %s"
331 msgstr "%s postou em %s" 314 msgstr "%s postou em %s"
332 315
333 -#: mural/views.py:655 316 +#: views.py:655
334 msgid "Mural - Per Subject" 317 msgid "Mural - Per Subject"
335 msgstr "Mural - Por Assunto" 318 msgstr "Mural - Por Assunto"
336 319
337 -#: mural/views.py:969 mural/views.py:1085 320 +#: views.py:969 views.py:1085
338 #, python-format 321 #, python-format
339 msgid "%s - Mural" 322 msgid "%s - Mural"
340 msgstr "%s - Mural" 323 msgstr "%s - Mural"
341 324
342 -#: mural/views.py:1207 325 +#: views.py:1207
343 msgid "Your post was published successfully!" 326 msgid "Your post was published successfully!"
344 msgstr "Sua postagem foi publicada com sucesso!" 327 msgstr "Sua postagem foi publicada com sucesso!"
345 328
346 -#: mural/views.py:1209 329 +#: views.py:1209
347 msgid "Your post was edited successfully!" 330 msgid "Your post was edited successfully!"
348 msgstr "Sua postagem foi editada com sucesso!" 331 msgstr "Sua postagem foi editada com sucesso!"
349 332
350 -#: mural/views.py:1216 333 +#: views.py:1216
351 msgid "Post deleted successfully!" 334 msgid "Post deleted successfully!"
352 msgstr "Postagem deletada com sucesso!" 335 msgstr "Postagem deletada com sucesso!"
353 336
354 -#: mural/views.py:1284 337 +#: views.py:1284
355 #, python-format 338 #, python-format
356 msgid "%s has commented in a post" 339 msgid "%s has commented in a post"
357 msgstr "%s comentou em um postagem" 340 msgstr "%s comentou em um postagem"
358 341
359 -#: mural/views.py:1443 342 +#: views.py:1443
360 msgid "Are you sure you want to delete this comment?" 343 msgid "Are you sure you want to delete this comment?"
361 msgstr "Você tem certeza que deseja deletar esse comentário?" 344 msgstr "Você tem certeza que deseja deletar esse comentário?"
362 345
363 -#: mural/views.py:1510 346 +#: views.py:1510
364 msgid "Your comment was published successfully!" 347 msgid "Your comment was published successfully!"
365 msgstr "Seu comentário foi publicado com sucesso!" 348 msgstr "Seu comentário foi publicado com sucesso!"
366 349
367 -#: mural/views.py:1512 350 +#: views.py:1512
368 msgid "Your comment was edited successfully!" 351 msgid "Your comment was edited successfully!"
369 msgstr "Seu comentário foi editado com sucesso!" 352 msgstr "Seu comentário foi editado com sucesso!"
370 353
371 -#: mural/views.py:1519 354 +#: views.py:1519
372 msgid "Comment deleted successfully!" 355 msgid "Comment deleted successfully!"
373 msgstr "Comentário deletado com sucesso!" 356 msgstr "Comentário deletado com sucesso!"
374 357
mural/models.py
1 from django.db import models 1 from django.db import models
2 from django.core import validators 2 from django.core import validators
3 from django.core.exceptions import ValidationError 3 from django.core.exceptions import ValidationError
4 -from django.utils.translation import ugettext_lazy as _ 4 +from django.utils.translation import ugettext_lazy as _, pgettext_lazy
5 5
6 from topics.decorators import always_as_child 6 from topics.decorators import always_as_child
7 7
@@ -12,13 +12,13 @@ from users.models import User @@ -12,13 +12,13 @@ from users.models import User
12 12
13 def validate_img_extension(value): 13 def validate_img_extension(value):
14 valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png'] 14 valid_formats = ['image/jpeg','image/x-citrix-jpeg','image/png','image/x-citrix-png','image/x-png']
15 - 15 +
16 if hasattr(value.file, 'content_type'): 16 if hasattr(value.file, 'content_type'):
17 if not value.file.content_type in valid_formats: 17 if not value.file.content_type in valid_formats:
18 raise ValidationError(_('File not supported.')) 18 raise ValidationError(_('File not supported.'))
19 19
20 class Mural(KnowsChild): 20 class Mural(KnowsChild):
21 - action = models.CharField(_('Action'), max_length = 100, default = "comment", choices = (("comment", _("Comment")), ("help", _("Ask for Help")))) 21 + action = models.CharField(_('Action'), max_length = 100, default = "comment", choices = (("comment", pgettext_lazy("modal","Comment")), ("help", pgettext_lazy("modal","Ask for Help"))))
22 post = models.TextField(_('Post'), blank = True) 22 post = models.TextField(_('Post'), blank = True)
23 image = models.ImageField(verbose_name = _('Image'), null=True, blank = True, upload_to = 'posts/', validators = [validate_img_extension]) 23 image = models.ImageField(verbose_name = _('Image'), null=True, blank = True, upload_to = 'posts/', validators = [validate_img_extension])
24 user = models.ForeignKey(User, verbose_name = _('User'), related_name = "post_user", null = True) 24 user = models.ForeignKey(User, verbose_name = _('User'), related_name = "post_user", null = True)
@@ -125,4 +125,4 @@ class MuralVisualizations(models.Model): @@ -125,4 +125,4 @@ class MuralVisualizations(models.Model):
125 """ 125 """
126 class MuralFavorites(models.Model): 126 class MuralFavorites(models.Model):
127 post = models.ForeignKey(Mural, verbose_name = _('Post'), related_name = 'favorites_post', null = True) 127 post = models.ForeignKey(Mural, verbose_name = _('Post'), related_name = 'favorites_post', null = True)
128 - user = models.ForeignKey(User, verbose_name = _('User'), related_name = "favorites_user", null = True)  
129 \ No newline at end of file 128 \ No newline at end of file
  129 + user = models.ForeignKey(User, verbose_name = _('User'), related_name = "favorites_user", null = True)
mural/templates/mural/_view_comment.html
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 {{ comment.user }} 11 {{ comment.user }}
12 <span class="user-action"> 12 <span class="user-action">
13 <i class="fa fa-commenting-o"></i> 13 <i class="fa fa-commenting-o"></i>
14 - {% trans 'Comment' %} 14 + {% trans 'Comment' context "view" %}
15 </span> 15 </span>
16 {% if comment|show_settings_comment:request.user %} 16 {% if comment|show_settings_comment:request.user %}
17 <span class="btn-group pull-right"> 17 <span class="btn-group pull-right">
@@ -39,4 +39,4 @@ @@ -39,4 +39,4 @@
39 <img src="{{ comment.image.url }}" class="img-responsive center-block" /> 39 <img src="{{ comment.image.url }}" class="img-responsive center-block" />
40 {% endif %} 40 {% endif %}
41 </div> 41 </div>
42 -</div>  
43 \ No newline at end of file 42 \ No newline at end of file
  43 +</div>