From 6dd43db2e2054fe6d7219d8bb8e45d42d66dba2b Mon Sep 17 00:00:00 2001 From: EnTeQuAk Date: Sun, 20 Jul 2008 15:48:26 +0200 Subject: [PATCH] small interface updates --- TODO | 3 +++ lodgeit/application.py | 3 +-- lodgeit/controllers/pastes.py | 2 +- lodgeit/i18n/de/LC_MESSAGES/messages.po | 4 ++-- lodgeit/i18n/messages.pot | 4 ++-- lodgeit/static/style.css | 4 ++++ lodgeit/utils.py | 2 ++ lodgeit/views/layout.html | 9 ++++++--- 8 files changed, 21 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 13846d7..ee8eb5f 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,6 @@ * Make it possible to tag and find pastes * Add a button to find all the personal (and private) pastes (cookie bound) + * Improve i18n support + * Improve LodgeIt Interface (null-interface + star) + * use udiff module instead of pygments-diff-highlighter for diff highlighning diff --git a/lodgeit/application.py b/lodgeit/application.py index 977812c..28efc78 100644 --- a/lodgeit/application.py +++ b/lodgeit/application.py @@ -34,8 +34,7 @@ class LodgeIt(object): metadata.create_all(self.engine) #: 18n setup - self.locale = None - self.set_locale('en_US') + self.locale = Locale('en') #: jinja_environment update jinja_environment.globals.update( diff --git a/lodgeit/controllers/pastes.py b/lodgeit/controllers/pastes.py index a4d0da4..2c8df52 100644 --- a/lodgeit/controllers/pastes.py +++ b/lodgeit/controllers/pastes.py @@ -40,7 +40,7 @@ class PasteController(object): if parent_id is not None: parent = Paste.get(parent_id) - spam = gerform('webpage') or antispam.is_spam(code) + spam = getform('webpage') or antispam.is_spam(code) if spam: error = _('your paste contains spam') captcha = getform('captcha') diff --git a/lodgeit/i18n/de/LC_MESSAGES/messages.po b/lodgeit/i18n/de/LC_MESSAGES/messages.po index a4185b4..80c17ab 100644 --- a/lodgeit/i18n/de/LC_MESSAGES/messages.po +++ b/lodgeit/i18n/de/LC_MESSAGES/messages.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2008-07-08 10:05+0200\n" -"PO-Revision-Date: 2008-07-09 08:39+0200\n" +"PO-Revision-Date: 2008-07-20 11:20+0200\n" "Last-Translator: Christopher Grebs \n" "Language-Team: de \n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.2\n" +"Generated-By: Babel 0.9.3\n" #: lodgeit/controllers/pastes.py:45 msgid "your paste contains spam" diff --git a/lodgeit/i18n/messages.pot b/lodgeit/i18n/messages.pot index dc4b490..095ca96 100644 --- a/lodgeit/i18n/messages.pot +++ b/lodgeit/i18n/messages.pot @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2008-07-09 08:39+0200\n" +"POT-Creation-Date: 2008-07-20 11:18+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 0.9.2\n" +"Generated-By: Babel 0.9.3\n" #: lodgeit/controllers/pastes.py:45 msgid "your paste contains spam" diff --git a/lodgeit/static/style.css b/lodgeit/static/style.css index 120636d..e77de08 100644 --- a/lodgeit/static/style.css +++ b/lodgeit/static/style.css @@ -102,11 +102,15 @@ div.text { border: 1px solid #000; } +#languages li.active img { + border: 2px solid #000; +} #paste { margin: 0; padding: 0; border: 1px solid #84BCCA; + overflow: auto; } #paste table, #paste tbody { diff --git a/lodgeit/utils.py b/lodgeit/utils.py index ebb30a2..c1e7fe2 100644 --- a/lodgeit/utils.py +++ b/lodgeit/utils.py @@ -83,5 +83,7 @@ def render_template(template_name, **tcontext): tcontext['new_replies'] = Paste.fetch_replies() if local.request: tcontext['request'] = local.request + if local.application: + tcontext['active_language'] = local.application.locale.language t = jinja_environment.get_template(template_name) return Response(t.render(tcontext), mimetype='text/html; charset=utf-8') diff --git a/lodgeit/views/layout.html b/lodgeit/views/layout.html index 502508d..d475abe 100644 --- a/lodgeit/views/layout.html +++ b/lodgeit/views/layout.html @@ -24,13 +24,16 @@ ('/about/', 'about', _('About')), ('/help/', 'help', '?') ] %} - {{ caption|e }} + + {{ caption|e }} + {%- endfor %}
    {% for lang in i18n_languages %} -
  • + + + {% endfor %}