From 3bf18ad5c7616379038ad301e7d92b9620159c57 Mon Sep 17 00:00:00 2001 From: Bruno Sarlo Date: Tue, 11 Aug 2009 15:41:48 -0300 Subject: Fixed voting problem. Should still work on i18n for JS voting and some urls. Non-ascii chars in tags bring syntax error for new meta-tags parsing. --- forum/models.py | 2 +- locale/es/LC_MESSAGES/django.po | 9 ++++----- templates/content/js/com.cnprog.i18n.js | 2 ++ templates/content/js/com.cnprog.post.js | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/forum/models.py b/forum/models.py index 9510476a..52f7af0f 100644 --- a/forum/models.py +++ b/forum/models.py @@ -180,7 +180,7 @@ class Question(models.Model): return [name for name in self.tagnames.split(u' ')] def tagname_meta_generator(self): - return ','.join([str(tag) for tag in self.tagname_list()]) + return u','.join([str(tag) for tag in self.tagname_list()]) def get_absolute_url(self): return '%s%s' % (reverse('question', args=[self.id]), self.title.replace(' ', '-')) diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po index 383ed961..16ccc51a 100644 --- a/locale/es/LC_MESSAGES/django.po +++ b/locale/es/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-08-11 04:13-0300\n" +"POT-Creation-Date: 2009-08-11 15:39-0300\n" "PO-Revision-Date: \n" "Last-Translator: Bruno Sarlo \n" "Language-Team: LANGUAGE \n" @@ -108,9 +108,8 @@ msgid "delete/" msgstr "borrar/" #: urls.py:50 -#, fuzzy msgid "question/" -msgstr "preguntas/" +msgstr "pregunta/" #: urls.py:51 urls.py:52 forum/views.py:740 forum/views.py:2013 msgid "tags/" @@ -1291,8 +1290,8 @@ msgid "" msgstr "" "Por ejemplo, si haces una pregunta interesante o das una respuesta útil, tu " "adición será votada positivamente. Por otro lado, si la respuesta es fuera " -"de lugar - será votada negativamente. Cada voto a favor genera 10" -" puntos, cada voto en contra restará 2 puntos. Hay " +"de lugar - será votada negativamente. Cada voto a favor genera 10 puntos, cada voto en contra restará 2 puntos. Hay " "un limite de 200 puntos que puedes acumular por pregunta o " "respuesta. La tabla debajo explica los puntos de reputación requeridos para " "cada tarea de moderación." diff --git a/templates/content/js/com.cnprog.i18n.js b/templates/content/js/com.cnprog.i18n.js index 848ad59e..6ba8b59d 100644 --- a/templates/content/js/com.cnprog.i18n.js +++ b/templates/content/js/com.cnprog.i18n.js @@ -140,6 +140,8 @@ var i18nEs = { 'enter image url':'introduzca la URL de la imagen, por ejemplo:
http://www.example.com/image.jpg \"titulo de imagen\"', 'enter url':'introduzca direcciones web, ejemplo:
http://www.cnprog.com/ \"titulo del enlace\"

"', 'upload image':'cargar imagen:', + 'questions/' : 'preguntas/', + 'vote/' : 'votar/', }; var i18n = { diff --git a/templates/content/js/com.cnprog.post.js b/templates/content/js/com.cnprog.post.js index 546cf101..aa6c51b6 100644 --- a/templates/content/js/com.cnprog.post.js +++ b/templates/content/js/com.cnprog.post.js @@ -243,7 +243,7 @@ var Vote = function(){ type: "POST", cache: false, dataType: "json", - url: "/questions/" + questionId + "/vote/", + url: "/" + $.i18n._("questions/") + questionId + "/" + $.i18n._("vote/"), data: { "type": voteType, "postId": postId }, error: handleFail, success: function(data){callback(object, voteType, data)}}); -- cgit v1.2.3-1-g7c22