aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar
diff options
context:
space:
mode:
authorJannis Leidel2012-03-31 22:32:43 +0200
committerJannis Leidel2012-03-31 22:32:43 +0200
commitd161058c9eb6a9ecb634084e6a4ed718afc45e28 (patch)
tree72ed86d16274b841362060dd1c01613d8f41b2fd /debug_toolbar
parent46011ac7c7baee0eb3ee874c0beb7aa4e243e801 (diff)
downloaddjango-debug-toolbar-d161058c9eb6a9ecb634084e6a4ed718afc45e28.tar.bz2
Marked a few more string for translation.
Diffstat (limited to 'debug_toolbar')
-rw-r--r--debug_toolbar/panels/sql.py30
1 files changed, 14 insertions, 16 deletions
diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py
index ffda54b..4534a44 100644
--- a/debug_toolbar/panels/sql.py
+++ b/debug_toolbar/panels/sql.py
@@ -1,3 +1,4 @@
+import os
import re
import uuid
@@ -31,15 +32,14 @@ def get_isolation_level_display(engine, level):
if engine == 'psycopg2':
import psycopg2.extensions
choices = {
- psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT: 'Autocommit',
- psycopg2.extensions.ISOLATION_LEVEL_READ_UNCOMMITTED: 'Read uncommitted',
- psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED: 'Read committed',
- psycopg2.extensions.ISOLATION_LEVEL_REPEATABLE_READ: 'Repeatable read',
- psycopg2.extensions.ISOLATION_LEVEL_SERIALIZABLE: 'Serializable',
+ psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT: _('Autocommit'),
+ psycopg2.extensions.ISOLATION_LEVEL_READ_UNCOMMITTED: _('Read uncommitted'),
+ psycopg2.extensions.ISOLATION_LEVEL_READ_COMMITTED: _('Read committed'),
+ psycopg2.extensions.ISOLATION_LEVEL_REPEATABLE_READ: _('Repeatable read'),
+ psycopg2.extensions.ISOLATION_LEVEL_SERIALIZABLE: _('Serializable'),
}
else:
raise ValueError(engine)
-
return choices.get(level)
@@ -47,15 +47,14 @@ def get_transaction_status_display(engine, level):
if engine == 'psycopg2':
import psycopg2.extensions
choices = {
- psycopg2.extensions.TRANSACTION_STATUS_IDLE: 'Idle',
- psycopg2.extensions.TRANSACTION_STATUS_ACTIVE: 'Active',
- psycopg2.extensions.TRANSACTION_STATUS_INTRANS: 'In transaction',
- psycopg2.extensions.TRANSACTION_STATUS_INERROR: 'In error',
- psycopg2.extensions.TRANSACTION_STATUS_UNKNOWN: 'Unknown',
+ psycopg2.extensions.TRANSACTION_STATUS_IDLE: _('Idle'),
+ psycopg2.extensions.TRANSACTION_STATUS_ACTIVE: _('Active'),
+ psycopg2.extensions.TRANSACTION_STATUS_INTRANS: _('In transaction'),
+ psycopg2.extensions.TRANSACTION_STATUS_INERROR: _('In error'),
+ psycopg2.extensions.TRANSACTION_STATUS_UNKNOWN: _('Unknown'),
}
else:
raise ValueError(engine)
-
return choices.get(level)
@@ -126,10 +125,9 @@ class SQLDebugPanel(DebugPanel):
def title(self):
count = len(self._databases)
-
- return __('SQL Queries from %(count)d connection', 'SQL Queries from %(count)d connections', count) % dict(
- count=count,
- )
+ return __('SQL Queries from %(count)d connection',
+ 'SQL Queries from %(count)d connections',
+ count) % dict(count=count)
def url(self):
return ''