From eae87ee0ecebb6df34ad5c6086f0223c93e7d491 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Wed, 17 Feb 2010 09:26:59 +0100 Subject: Added language option * 'language' in section 'style' can be de, at, en, us, ... --- blogthon.cgi | 25 ++++++++++++++++--------- configuration | 1 + plugins/plugin_example.pyc | Bin 0 -> 309 bytes 3 files changed, 17 insertions(+), 9 deletions(-) create mode 100644 plugins/plugin_example.pyc diff --git a/blogthon.cgi b/blogthon.cgi index 4cec664..c8c5a61 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -109,6 +109,13 @@ if not os.path.exists(plugins_dir): try: style = configuration.get('look', 'style') except: errorpage('"style" is missing in configuration!') +try: language = configuration.get('look', 'language') +except: errorpage('"language" is missing in configuration!') +if language == "de" or language == "at": + locale = ("Seiten", "Monate", "Links", "Keine Kommentare", "Kommentare", "Alle Einträge anzeigen...", "Name", "Text", "Absenden") +else: + locale = ("pages", "months", "links", "no comments", "comments", "View all entries...", "name", "text", "commit") + try: entries_per_page = configuration.getint('look', 'entries_per_page') except: errorpage('"entries_per_page" is missing in configuration!') @@ -346,7 +353,7 @@ else: staticpages_list = glob.glob(staticpages_dir + '*') staticpages_list.sort() print '
' - print '
pages
' + print '
' + locale[0] + '
' print '
' print '
    ' for staticpage in staticpages_list: @@ -370,7 +377,7 @@ else: if monthlist == "True": olddate = "" print '
    ' - print '
    months
    ' + print '
    ' + locale[1] + '
    ' print '
    ' print '
      ' for entry in entries: @@ -388,7 +395,7 @@ else: # Linklist if linklist == "True": print ' ' print '' @@ -543,7 +550,7 @@ else: for line in comments_content: if line.split(".", 1)[0] == "-": comments_counter += 1 print '
      ' - print ' comments (' + str(comments_counter) + ')' + print ' ' + locale[4] + ' (' + str(comments_counter) + ')' print '
      ' print '
    ' print '' @@ -556,7 +563,7 @@ else: entry_counter += 1 if not month_display and not post_display and not allentries_display and entry_counter == entries_per_page: # Display pagelist - print '
    View all entries...
    ' + print '
    ' + locale[5] + '
    ' print '
    ' print '' diff --git a/configuration b/configuration index 2ba3f00..8f7a91e 100644 --- a/configuration +++ b/configuration @@ -10,6 +10,7 @@ plugins_dir: plugins/ [look] style: blogthon +language: en entries_per_page: 20 staticpages: True monthlist: True diff --git a/plugins/plugin_example.pyc b/plugins/plugin_example.pyc new file mode 100644 index 0000000..99bb214 Binary files /dev/null and b/plugins/plugin_example.pyc differ -- cgit v1.2.3