damned-lies r1165 - in trunk: . stats templates
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1165 - in trunk: . stats templates
- Date: Thu, 13 Nov 2008 19:40:51 +0000 (UTC)
Author: claudep
Date: Thu Nov 13 19:40:51 2008
New Revision: 1165
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1165&view=rev
Log:
2008-11-13 Claude Paroz <claude 2xlibre net>
* stats/models.py: New module.get_description, potbase name changed for
help pot files (eog-head.HEAD.fr.po instead of help.HEAD.fr.po). Various
small improvements.
* templates/module.html:
* stats/views.py: Replace translated_name by a method call.
Modified:
trunk/ChangeLog
trunk/stats/models.py
trunk/stats/views.py
trunk/templates/module.html
Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py (original)
+++ trunk/stats/models.py Thu Nov 13 19:40:51 2008
@@ -47,7 +47,7 @@
bugs_product = models.CharField(max_length=50)
bugs_component = models.CharField(max_length=50)
vcs_type = models.CharField(max_length=5, choices=VCS_TYPE_CHOICES)
- vcs_root = models.URLField()
+ vcs_root = models.URLField(verify_exists=False)
vcs_web = models.URLField()
maintainers = models.ManyToManyField(Person, db_table='module_maintainer',
@@ -64,6 +64,12 @@
def get_absolute_url(self):
return ('stats.views.module', [self.name])
+ def get_description(self):
+ if self.description:
+ return _(self.description)
+ else:
+ return self.name
+
def get_bugs_i18n_url(self):
if self.bugs_base.find("bugzilla") != -1 or self.bugs_base.find("freedesktop") != -1:
return "%sbuglist.cgi?product=%s&component=%s&keywords_type=anywords&keywords=I18N+L10N&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=NEEDINFO" % (self.bugs_base, self.bugs_product, self.bugs_component)
@@ -263,7 +269,7 @@
stat.untranslated = int(pot_stats['untranslated'])
stat.date = datetime.now()
Information.objects.filter(Statistics=stat).delete()
- except:
+ except Statistics.DoesNotExist:
stat = Statistics(language = None, branch = self, domain = dom, translated = 0,
fuzzy = 0, untranslated = int(pot_stats['untranslated']))
stat.save()
@@ -304,10 +310,10 @@
stat.untranslated = int(langstats['untranslated'])
stat.date = datetime.now()
Information.objects.filter(Statistics=stat).delete()
- except:
+ except Statistics.DoesNotExist:
try:
language = Language.objects.get(locale=lang)
- except:
+ except Language.DoesNotExist:
language = Language(name=lang, locale=lang)
language.save()
stat = Statistics(language = language, branch = self, domain = dom, translated = int(langstats['translated']),
@@ -459,7 +465,10 @@
def potbase(self):
if self.name[:2] == 'po':
+ # e.g. replace po by gimp (for ui), or po-plugins by gimp-plugins
return self.module.name + self.name[2:]
+ elif self.name == 'help':
+ return "%s-help" % self.module.name
else:
return self.name
@@ -943,7 +952,6 @@
subdir = "docs/"
else:
subdir = ""
- #return self.filename()
return "/POT/%s.%s/%s%s" % (self.module_name(), self.branch.name, subdir, self.filename())
def most_important_message(self):
Modified: trunk/stats/views.py
==============================================================================
--- trunk/stats/views.py (original)
+++ trunk/stats/views.py Thu Nov 13 19:40:51 2008
@@ -39,7 +39,6 @@
def module(request, module_name):
mod = Module.objects.get(name = module_name)
- mod.translated_name = _(mod.description)
context = {
'pageSection': "module",
'module': mod,
Modified: trunk/templates/module.html
==============================================================================
--- trunk/templates/module.html (original)
+++ trunk/templates/module.html Thu Nov 13 19:40:51 2008
@@ -1,12 +1,12 @@
{% extends "base.html" %}
{% load i18n %}
-{% block title %} {% blocktrans with module.description as name %}Module Statistics: {{ name }}{% endblocktrans %} {% endblock %}
+{% block title %} {% blocktrans with module.get_description as name %}Module Statistics: {{ name }}{% endblocktrans %} {% endblock %}
{% block content %}
<div class="mainpage">
-<h1>{{ module.translated_name }}</h1>
+<h1>{{ module.get_description }}</h1>
{% if module.comment %}
<p>{{ module.comment|safe }}</p>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]