[damned-lies] Make vis_stats return 100% untranslated when receiving unknown parameter
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Make vis_stats return 100% untranslated when receiving unknown parameter
- Date: Tue, 9 Oct 2012 16:06:11 +0000 (UTC)
commit c92f138761f3c51976913986c10511f1dea90a52
Author: Claude Paroz <claude 2xlibre net>
Date: Tue Oct 9 18:05:13 2012 +0200
Make vis_stats return 100% untranslated when receiving unknown parameter
stats/templatetags/stats_extras.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/stats/templatetags/stats_extras.py b/stats/templatetags/stats_extras.py
index efc8710..fe97f16 100644
--- a/stats/templatetags/stats_extras.py
+++ b/stats/templatetags/stats_extras.py
@@ -106,7 +106,9 @@ def vis_stats(stat, scope='full'):
elif isinstance(stat, dict):
trans, fuzzy, untrans = stat['translated_perc'], stat['fuzzy_perc'], stat['untranslated_perc']
else:
- return ""
+ return mark_safe("""<div class="untranslated" style="%(dir)s:0px; width: 100px;"></div>""" % {
+ 'dir' : get_language_bidi() and "right" or "left"
+ })
return mark_safe("""
<div class="translated" style="width: %(trans)spx;"></div>
<div class="fuzzy" style="%(dir)s:%(trans)spx; width:%(fuzzy)spx;"></div>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]