damned-lies r1460 - in trunk: . languages stats
- From: claudep svn gnome org
- To: svn-commits-list gnome org
- Subject: damned-lies r1460 - in trunk: . languages stats
- Date: Tue, 3 Mar 2009 21:55:14 +0000 (UTC)
Author: claudep
Date: Tue Mar 3 21:55:14 2009
New Revision: 1460
URL: http://svn.gnome.org/viewvc/damned-lies?rev=1460&view=rev
Log:
2009-03-03 Claude Paroz <claude 2xlibre net>
* languages/models.py:
* languages/views.py:
* stats/models.py: Now that URLs admit '@', slug/unslug locale is of no
use.
Modified:
trunk/ChangeLog
trunk/languages/models.py
trunk/languages/views.py
trunk/stats/models.py
Modified: trunk/languages/models.py
==============================================================================
--- trunk/languages/models.py (original)
+++ trunk/languages/models.py Tue Mar 3 21:55:14 2009
@@ -14,18 +14,6 @@
def __unicode__(self):
return "%s (%s)" % (self.name, self.locale)
- @classmethod
- def slug_locale(cls, loc_string):
- if loc_string:
- return loc_string.replace('@', '_at_')
- return None
-
- @classmethod
- def unslug_locale(cls, loc_string):
- if loc_string:
- return loc_string.replace('_at_', '@')
- return None
-
def get_name(self):
if self.name != self.locale:
return _(self.name)
Modified: trunk/languages/views.py
==============================================================================
--- trunk/languages/views.py (original)
+++ trunk/languages/views.py Tue Mar 3 21:55:14 2009
@@ -41,7 +41,7 @@
context_instance=RequestContext(request))
def language_all(request, locale, dtype):
- language = get_object_or_404(Language, locale=Language.unslug_locale(locale))
+ language = get_object_or_404(Language, locale=locale)
stats = Statistics.get_lang_stats_by_type(language, dtype, release=None)
context = {
'pageSection': "languages",
@@ -55,7 +55,7 @@
context_instance=RequestContext(request))
def language_release(request, locale, release_name, dtype):
- language = get_object_or_404(Language, locale=Language.unslug_locale(locale))
+ language = get_object_or_404(Language, locale=locale)
release = get_object_or_404(Release, name=release_name)
stats = Statistics.get_lang_stats_by_type(language, dtype, release)
context = {
@@ -93,7 +93,7 @@
""" This view create the same XML output than the previous Damned-Lies, so as
apps which depend on it (like Vertimus) don't break.
This view may be suppressed when Vertimus will be integrated in D-L. """
- language = get_object_or_404(Language, locale=Language.unslug_locale(locale))
+ language = get_object_or_404(Language, locale=locale)
release = get_object_or_404(Release, name=release_name)
stats = release.get_lang_stats(language)
content = "<stats language=\"%s\" release=\"%s\">\n" % (locale, release_name)
Modified: trunk/stats/models.py
==============================================================================
--- trunk/stats/models.py (original)
+++ trunk/stats/models.py Tue Mar 3 21:55:14 2009
@@ -747,7 +747,7 @@
if row[1] not in stats:
# Initialize stats dict
stats[row[1]] = {
- 'lang_name': row[0], 'lang_locale': Language.slug_locale(row[1]),
+ 'lang_name': row[0], 'lang_locale': row[1],
'doc_trans': 0, 'doc_fuzzy': 0, 'doc_untrans': total_docstrings,
'doc_percent': 0, 'doc_percentfuzzy': 0, 'doc_percentuntrans': 100,
'ui_trans': 0, 'ui_fuzzy': 0, 'ui_untrans': total_uistrings,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]