damned-lies r1156 - in trunk: . stats/management/commands teams templates/teams
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1156 - in trunk: . stats/management/commands teams templates/teams
- Date: Sun, 9 Nov 2008 23:13:37 +0000 (UTC)
Author: claudep
Date: Sun Nov 9 23:13:37 2008
New Revision: 1156
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1156&view=rev
Log:
2008-11-10 Claude Paroz <claude 2xlibre net>
* stats/management/commands/update-trans.py: Triple quotes strings to
avoid quote escaping.
* teams/models.py: Add get_description (translated description).
* templates/teams/team_detail.html: Use get_description for correct team
lang translation.
Modified:
trunk/ (props changed)
trunk/ChangeLog
trunk/stats/management/commands/update-trans.py
trunk/teams/models.py
trunk/templates/teams/team_detail.html
Modified: trunk/stats/management/commands/update-trans.py
==============================================================================
--- trunk/stats/management/commands/update-trans.py (original)
+++ trunk/stats/management/commands/update-trans.py Sun Nov 9 23:13:37 2008
@@ -40,13 +40,13 @@
SELECT name from `language` WHERE name <> locale UNION DISTINCT
SELECT description FROM domain UNION DISTINCT
SELECT description FROM module WHERE description <> name UNION DISTINCT
- SELECT comment FROM module WHERE comment IS NOT NULL UNION DISTINCT
+ SELECT comment FROM module WHERE comment IS NOT NULL AND comment<>'' UNION DISTINCT
SELECT description FROM `release`;"""
cursor = connection.cursor()
cursor.execute(query)
for row in cursor.fetchall():
if row[0] is not None:
- f.write("_(u'%s')\n" % row[0].encode('utf-8'))
+ f.write("_(u\"\"\"%s\"\"\")\n" % row[0].encode('utf-8'))
f.close()
# Run makemessages -l ll
Modified: trunk/teams/models.py
==============================================================================
--- trunk/teams/models.py (original)
+++ trunk/teams/models.py Sun Nov 9 23:13:37 2008
@@ -45,6 +45,9 @@
def get_absolute_url(self):
return ('team_slug', [self.name])
+ def get_description(self):
+ return _(self.description)
+
def get_languages(self):
return self.language_set.all()
@@ -61,6 +64,9 @@
# FIXME: try to avoid using a hard-coded link
return "/teams/%s" % self.language.locale
+ def get_description(self):
+ return self.language.locale
+
def get_languages(self):
return (self.language,)
Modified: trunk/templates/teams/team_detail.html
==============================================================================
--- trunk/templates/teams/team_detail.html (original)
+++ trunk/templates/teams/team_detail.html Sun Nov 9 23:13:37 2008
@@ -1,19 +1,20 @@
{% extends "base.html" %}
{% load i18n %}
-{% block title %}{% trans team.description %}{% endblock %}
+{% block title %}{{ team.get_description }}{% endblock %}
{% block content %}
<div class="mainpage">
+{% with team.get_description as lang %}
{% if not team.fake %}
-<h1>{% blocktrans with team.description as lang %}{{ lang }} Translation Team{% endblocktrans %}</h1>
+<h1>{% blocktrans %}{{ lang }} Translation Team{% endblocktrans %}</h1>
<table><tr><td valign="top" width="50%">
<h2>{% trans "Details" %}</h2>
{% if team.webpage_url %}
- <strong>{% blocktrans with team.description as lang %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong>
+ <strong>{% blocktrans %}{{ lang }} Translation Team Page:{% endblocktrans %}</strong>
<a href="{{ team.webpage_url }}">{{ team.webpage_url }}</a><br />
{% endif %}
@@ -46,8 +47,9 @@
{% endif %}
</td></tr></table>
{% else %}
-<h1>{{ team.description }}</h1>
+<h1>{{ lang }}</h1>
{% endif %}
+{% endwith %}
{% for lang in team.get_languages %}
<h2>{% trans lang.name %}</h2>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]