diff options
| author | Jannis Leidel | 2012-03-05 17:17:22 +0100 | 
|---|---|---|
| committer | Jannis Leidel | 2012-03-05 17:31:44 +0100 | 
| commit | d1b5f1d67d56adc0858c6954df794fb988e5c103 (patch) | |
| tree | f749137b3e4e820d9b0d7e4666b0c13d103c41bc /debug_toolbar/panels/cache.py | |
| parent | b9d06ce26ed8090f75f5864f60d9ae85f9118cad (diff) | |
| download | django-debug-toolbar-d1b5f1d67d56adc0858c6954df794fb988e5c103.tar.bz2 | |
Use i18n for the cache and SQL panels.
Diffstat (limited to 'debug_toolbar/panels/cache.py')
| -rw-r--r-- | debug_toolbar/panels/cache.py | 11 | 
1 files changed, 9 insertions, 2 deletions
| diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index ace343b..1656932 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -3,7 +3,7 @@ import inspect  from django.core import cache  from django.core.cache.backends.base import BaseCache -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _, ungettext  from debug_toolbar.panels import DebugPanel @@ -89,7 +89,14 @@ class CacheDebugPanel(DebugPanel):              cache.cache = self.cache      def nav_title(self): -        return _('Cache: %.2fms') % self.cache.total_time +        return _('Cache') + +    def nav_subtitle(self): +        cache_calls = len(self.cache.calls) +        return ungettext('%(cache_calls)d call in %(time).2fms', +                         '%(cache_calls)d calls in %(time).2fms', +                         cache_calls) % {'cache_calls': cache_calls, +                                         'time': self.cache.total_time}      def title(self):          return _('Cache Usage') | 
