aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-01-20 16:44:00 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-01-20 16:44:00 +0100
commit93a2b996386c989bd28013332086f7489e7c7b52 (patch)
tree4d8f274f416a94ae4136d4f22f2aacf7cefb2139
parent3488b0c58caa8250c81fd2d5e5a15a2d4332e2e1 (diff)
added localization support + german language
-rw-r--r--.bzrignore2
-rw-r--r--Makefile25
-rwxr-xr-xaccess_control.rb50
-rwxr-xr-xcustomize.rb59
-rw-r--r--default.css9
-rwxr-xr-xdelete_poll.rb54
-rw-r--r--dudle.rb63
-rwxr-xr-xedit_columns.rb31
-rwxr-xr-xhistory.rb11
-rwxr-xr-xindex.cgi39
-rwxr-xr-xinvite_participants.rb5
-rw-r--r--locale/de/dudle.po524
-rw-r--r--log.rb3
-rwxr-xr-xoverview.rb13
-rwxr-xr-xparticipate.rb2
-rw-r--r--poll.rb49
-rw-r--r--pollhead.rb18
-rw-r--r--timepollhead.rb28
18 files changed, 801 insertions, 184 deletions
diff --git a/.bzrignore b/.bzrignore
index 98c7d6e..cf684d0 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1,3 +1,5 @@
intern
config.rb
css/*
+locale/dudle.pot
+locale/de/dudle.mo
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..479ddab
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,25 @@
+############################################################################
+# Copyright 2009 Benjamin Kellermann #
+# #
+# This file is part of dudle. #
+# #
+# Dudle is free software: you can redistribute it and/or modify it under #
+# the terms of the GNU Affero General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# Dudle is distributed in the hope that it will be useful, but WITHOUT ANY #
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public #
+# License for more details. #
+# #
+# You should have received a copy of the GNU Affero General Public License #
+# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
+############################################################################
+
+locale/dudle.pot: *.rb *.cgi
+ rm locale/dudle.pot
+ rgettext *.cgi *.rb -o locale/dudle.pot
+
+%.mo: %.po
+ rmsgfmt $*.po -o $*.mo
diff --git a/access_control.rb b/access_control.rb
index dfe3381..6701738 100755
--- a/access_control.rb
+++ b/access_control.rb
@@ -23,7 +23,7 @@ if __FILE__ == $0
load "../dudle.rb"
-$d = Dudle.new("Access Control")
+$d = Dudle.new
acusers = {}
@@ -71,11 +71,12 @@ def add_to_htdigest(user,password)
end
def createform(userarray,hint,acusers)
+ usernamestr = _("Username:")
ret = <<FORM
<form id='ac_#{userarray[0]}' method='post' action='' >
- <table summary='Enter Access Control details' class='settingstable'>
+ <table class='settingstable'>
<tr>
- <td class='label'>Username:</td>
+ <td class='label'>#{usernamestr}</td>
<td title="#{userarray[1]}">
#{userarray[0]}
<input type='hidden' name='ac_user' value='#{userarray[0]}' />
@@ -83,10 +84,12 @@ def createform(userarray,hint,acusers)
</tr>
FORM
+ passwdstr = _("Password")
+ repeatstr = _("repeat")
2.times{|i|
ret += <<PASS
<tr>
- <td class='label'><label for='password#{i}'>Password#{i == 1 ? " (repeat)" : ""}:</label></td>
+ <td class='label'><label for='password#{i}'>#{passwdstr}#{i == 1 ? " (#{repeatstr})" : ""}:</label></td>
<td>
PASS
if acusers.include?(userarray[0])
@@ -108,12 +111,14 @@ PASS
FORM
if acusers.include?(userarray[0])
if userarray[0] == "admin" && acusers.include?("participant")
- ret += "<div class='shorttextcolumn'>You have to remove the participant user before you can remove the administrator.</div>"
+ ret += "<div class='shorttextcolumn'>" + _("You have to remove the participant user before you can remove the administrator.") + "</div>"
else
- ret += "<input type='submit' name='ac_delete_#{userarray[0]}' value='Delete' />"
+ ret += "<input type='hidden' name='ac_delete_#{userarray[0]}' value='Delete' />"
+ ret += "<input type='submit' value='" + _("Delete") + "' />"
end
else
- ret += "<input type='submit' name='ac_create' value='Save' />"
+ ret += "<input type='hidden' name='ac_create' value='Save' />"
+ ret += "<input type='submit' value='" + _("Save") + "' />"
end
ret += <<FORM
@@ -131,9 +136,9 @@ if $cgi.include?("ac_user")
user = $cgi["ac_user"]
if !(user =~ /^[\w]*$/)
# add user
- usercreatenotice = "<div class='error'>Only uppercase, lowercase, digits are allowed in the username.</div>"
+ usercreatenotice = "<div class='error'>" + _("Only letters and digits are allowed in the username.") + "</div>"
elsif $cgi["ac_password0"] != $cgi["ac_password1"]
- usercreatenotice = "<div class='error'>Passwords did not match.</div>"
+ usercreatenotice = "<div class='error'>" + _("Passwords did not match.") + "</div>"
else
if $cgi.include?("ac_create")
add_to_htdigest(user,$cgi["ac_password0"])
@@ -166,43 +171,46 @@ $d.wizzard_redirect
if $d.html.header["status"] != "REDIRECT"
-$d.html << "<h2>Change Access Control Settings</h2>"
+$d.html << "<h2>" + _("Change Access Control Settings") + "</h2>"
if acusers.empty? && $cgi["ac_activate"] != "Activate"
- acstatus = ["red","not activated"]
- acswitchbutton = "<input type='submit' name='ac_activate' value='Activate' />"
+ acstatus = ["red",_("not activated")]
+ acswitchbutton = "<input type='hidden' name='ac_activate' value='Activate' />"
+ acswitchbutton += "<input type='submit' value='" + _("Activate") + "' />"
else
if acusers.empty?
- acstatus = ["blue","will be activated when at least an admin user is configured"]
- acswitchbutton = "<input type='submit' name='ac_activate' value='Deactivate' />"
+ acstatus = ["blue",_("will be activated when at least an admin user is configured")]
+ acswitchbutton = "<input type='hidden' name='ac_activate' value='Deactivate' />"
+ acswitchbutton += "<input type='submit' value='" + _("Deactivate") + "' />"
else
- acstatus = ["green", "activated"]
- acswitchbutton = "<div class='shorttextcolumn'>You have to remove all users before you can deactivate the access control settings.</div>"
+ acstatus = ["green", _("activated")]
+ acswitchbutton = "<div class='shorttextcolumn'>" + _("You have to remove all users before you can deactivate the access control settings.") + "</div>"
end
- admincreatenotice = usercreatenotice || "You will be asked for the password you entered here after pressing save!"
+ admincreatenotice = usercreatenotice || _("You will be asked for the password you entered here after pressing save!")
user = ["admin",
- "The user ‘admin’ has access to the vote as well as the configuration interface."]
+ _("The user ‘admin’ has access to the vote as well as the configuration interface.")]
createform = createform(user,admincreatenotice,acusers)
if acusers.include?("admin")
participantcreatenotice = usercreatenotice || ""
user = ["participant",
- "The user ‘participant’ has only access to the vote interface."]
+ _("The user ‘participant’ has only access to the vote interface.")]
createform += createform(user,participantcreatenotice,acusers)
end
end
+acstr = _("Access control:")
$d.html << <<AC
<form id='ac' method='post' action='' >
-<table summary='Enable Access Control settings' class='settingstable'>
+<table class='settingstable'>
<tr>
<td>
- Access control:
+ #{acstr}
</td>
<td style='color: #{acstatus[0]}'>
#{acstatus[1]}
diff --git a/customize.rb b/customize.rb
index 97e6a42..282c102 100755
--- a/customize.rb
+++ b/customize.rb
@@ -25,22 +25,20 @@ if __FILE__ == $0
$:.push("..")
require "dudle"
-$d = Dudle.new("Customize")
+$d = Dudle.new
-$d << <<END
-<h2>Customize Personal Settings</h2>
-You need cookies enabled in order to personalize your settings.
-END
+$d << "<h2>" + _("Customize Personal Settings") + "</h2>"
+$d << _("You need cookies enabled in order to personalize your settings.")
-def choosetable(tablesummary, options, cursetting)
+def choosetable(options, cursetting)
ret = <<HEAD
-<table summary='#{tablesummary}'>
+<table>
<tr>
- <th>Current Setting</th>
- <th>Description</th>
- </tr>
HEAD
+ ret += "<th>" + _("Current Setting") + "</th>"
+ ret += "<th>" + _("Description") + "</th>"
+ ret += "</tr>"
options.each{|description,href,title|
selected = href == cursetting
ret += "<tr><td>"
@@ -56,26 +54,22 @@ HEAD
end
-a = [["Use special characters (#{UTFCHARS})","utf", "Use this option if you see the characters in the parenthesis."],
- ["Use only normal strings","ascii","Use this option if you have problems with some characters."]]
+a = [[_("Use special characters") + " (#{UTFCHARS})","utf", _("Use this option if you see the characters in the parenthesis.")],
+ [_("Use only normal strings"),"ascii",_("Use this option if you have problems with some characters.")]]
$d.html.add_cookie("ascii","true","/",Time.now + (1*60*60*24*365 * ($USEUTF ? -1 : 1 )))
-$d << <<CHARSET
-<div id='charset'>
-<h3>Charset</h3>
-#{choosetable("Charset settings",a,$USEUTF ? "utf" : "ascii")}
-</div>
-CHARSET
+$d << "<div id='charset'>"
+$d << "<h3>" + _("Charset")+ "</h3>"
+$d << choosetable(a,$USEUTF ? "utf" : "ascii")
+$d << "</div>"
css = $cgi.cookies["css"][0]
css = $cgi["css"] if $cgi.include?("css")
css ||= "default.css"
$d.html.add_cookie("css",css,"/",Time.now + (1*60*60*24*365 * (css == "dudle.css" ? -1 : 1 )))
-$d << <<CSS
-<div id='config_stylesheet'>
-<h3>Stylesheet</h3>
-#{choosetable("Stylesheet settings",$d.css.collect{|href| [href.scan(/([^\/]*)\.css/).flatten[0],"css=#{href}"]},"css=#{css}")}
-</div>
-CSS
+$d << "<div id='config_stylesheet'>"
+$d << "<h3>" + _("Stylesheet") + "</h3>"
+$d << choosetable($d.css.collect{|href| [href.scan(/([^\/]*)\.css/).flatten[0],"css=#{href}"]},"css=#{css}")
+$d << "</div>"
username = $cgi.cookies["username"][0]
@@ -88,14 +82,17 @@ elsif $cgi.include?("username")
end
+
+defaultuserstr = _("Default Username")
+usernamestr = _("Username:")
$d << <<CHARSET
<div id='config_user'>
-<h3>Default Username</h3>
+<h3>#{defaultuserstr}</h3>
<form method='get' action=''>
- <table summary="Set default username">
- <tr>
+ <table>
+ <tr id='usernamesetting'>
<td>
- <label for='username'>Username: </label>
+ <label for='username'>#{usernamestr} </label>
</td>
<td class='settingstable'>
CHARSET
@@ -110,8 +107,8 @@ if username && !$cgi.include?("edit")
<tr>
<td></td>
<td class='settingstable'>
- <input id='username' type='submit' value='Edit' />
CHARSET
+ $d << "<input id='username' type='submit' value='" + _("Edit") + "' />"
else
$d << <<CHARSET
<input id='username' type='text' value="#{username}" name='username' />
@@ -120,11 +117,11 @@ else
<tr>
<td></td>
<td class='settingstable'>
- <input type='submit' value='Save' />
CHARSET
+ $d << "<input type='submit' value='" + _("Save") + "' />"
end
-$d.html << "<input type='submit' name='delete_username' value='Delete' />" if username
+$d.html << "<input type='submit' name='delete_username' value='" + _("Delete") + "' />" if username
$d << <<CHARSET
</td>
diff --git a/default.css b/default.css
index 3761d51..08ba509 100644
--- a/default.css
+++ b/default.css
@@ -84,7 +84,7 @@ table.calendarday {
}
div#AddRemoveColumndaysDescription{
- max-width: 12em;
+ max-width: 15em;
}
table.calendarday th, table.calendarday td{
@@ -118,6 +118,9 @@ td.settingstable, table.settingstable td{
table.settingstable td.label{
text-align: right;
}
+tr#usernamesetting {
+ height: 1.7em
+}
td.historycomment{
text-align: left;
@@ -208,10 +211,10 @@ html {
.shorttextcolumn{
text-align: left;
- max-width: 18em;
+ max-width: 20em;
}
.hint{
- font-size:small;
+ font-size:0.9em;
}
div#tabs ul{
diff --git a/delete_poll.rb b/delete_poll.rb
index 75f63db..8284f5f 100755
--- a/delete_poll.rb
+++ b/delete_poll.rb
@@ -22,32 +22,40 @@
if __FILE__ == $0
load "../dudle.rb"
-$d = Dudle.new("Delete Poll")
+$d = Dudle.new
require "ftools"
-QUESTIONS = ["Yes, I know what I am doing!",
- "I hate these stupid entry fields.",
- "I am aware of the consequences.",
- "Please delete this poll."]
+QUESTIONS = [_("Yes, I know what I am doing!"),
+ _("I hate these stupid entry fields."),
+ _("I am aware of the consequences."),
+ _("Please delete this poll.")]
if $cgi.include?("confirmnumber")
CONFIRM = $cgi["confirmnumber"].to_i
if $cgi["confirm"] == QUESTIONS[CONFIRM]
Dir.chdir("..")
File.move($d.urlsuffix, "/tmp/#{$d.urlsuffix}.#{rand(9999999)}")
+
+ deleteconfirmstr = _("The poll was deleted successfully!")
+ accidentstr = _("If this was done by accident, please contact the administrator of the system. The poll can be recovered for an indeterministic amount of time, maybe it is already to late.")
+ nextthingsstr = _("Things you can do now are")
+ homepagestr = _("Return to dudle home and Schedule a new Poll")
+ wikipediastr = _("Browse Wikipedia")
+ googlestr = _("Search something with Google")
+
$d.html << <<SUCCESS
<p class='textcolumn'>
- The poll was deleted successfully!
+ #{deleteconfirmstr}
</p>
<p class='textcolumn'>
- If this was done by accident, please contact the administrator of the system.
- The poll can be recovered for an indeterministic amount of time, maybe it is already to late. </p>
+ #{accidentstr}
+</p>
<div class='textcolumn'>
- Things you can do now are
+ #{nextthingsstr}
<ul>
- <li><a href='../'>Return to dudle home and Schedule a new Poll</a></li>
- <li><a href='http://wikipedia.org'>Browse Wikipedia</a></li>
- <li><a href='http://www.google.de'>Search something with Google</a></li>
+ <li><a href='../'>#{homepagestr}</a></li>
+ <li><a href='http://wikipedia.org'>#{wikipediastr}</a></li>
+ <li><a href='http://www.google.com'>#{googlestr}</a></li>
</ul>
</div>
SUCCESS
@@ -55,10 +63,12 @@ SUCCESS
exit
else
hint = <<HINT
-<table style='background:lightgray' summary='Error about wrong confirmation string'>
+<table style='background:lightgray'>
<tr>
<td style='text-align:right'>
- To delete the poll, you have to type:
+HINT
+ hint += _("To delete the poll, you have to type:")
+ hint += <<HINT
</td>
<td class='warning' style='text-align:left'>
#{QUESTIONS[CONFIRM]}
@@ -66,7 +76,9 @@ SUCCESS
</tr>
<tr>
<td style='text-align:right'>
- but you typed:
+HINT
+ hint += _("but you typed:")
+ hint += <<HINT
</td>
<td class='warning' style='text-align:left'>
#{$cgi["confirm"]}
@@ -78,17 +90,19 @@ HINT
else
CONFIRM = rand(QUESTIONS.size)
end
+
+$d.html << "<h2>" + _("Delete this Poll") + "</h2>"
+$d.html << _("You want to delete the poll named") + " <b>#{$d.table.name}</b>.<br />"
+$d.html << _("This is an irreversible action!") + "<br />"
+$d.html << _("If you are sure in what you are doing, please type into the form") + " " + _("“") + QUESTIONS[CONFIRM] + _("”")
+deletestr = _("Delete")
$d.html << <<TABLE
- <h2>Delete this Poll</h2>
- You want to delete the poll named <b>#{$d.table.name}</b>.<br />
- This is an irreversible action!<br />
- If you are sure in what you are doing, please type into the form “#{QUESTIONS[CONFIRM]}”
#{hint}
<form method='post' action=''>
<div>
<input type='hidden' name='confirmnumber' value='#{CONFIRM}' />
<input size='30' type='text' name='confirm' value='#{$cgi["confirm"]}' />
- <input type='submit' value='Delete' />
+ <input type='submit' value='#{deletestr}' />
</div>
</form>
TABLE
diff --git a/dudle.rb b/dudle.rb
index c291fb4..ae3e615 100644
--- a/dudle.rb
+++ b/dudle.rb
@@ -22,6 +22,11 @@ require "cgi"
$cgi = CGI.new
+require 'gettext'
+require 'gettext/cgi'
+include GetText
+GetText.cgi=$cgi
+
$:.push("..")
require "html"
require "poll"
@@ -33,19 +38,19 @@ class Dudle
def tabs(active_tab)
ret = "<div id='tabs'><ul>"
tabs = []
- tabs << ["Home",@basedir]
+ tabs << [_("Home"),@basedir]
if @is_poll
tabs << ["",""]
tabs += @usertabs
tabs << ["",""]
tabs += @configtabs
- tabs << ["Delete Poll","delete_poll.cgi"]
+ tabs << [_("Delete Poll"),"delete_poll.cgi"]
tabs << ["",""]
end
- tabs << ["Customize","customize.cgi"]
+ tabs << [_("Customize"),"customize.cgi"]
tabs.each{|tab,file|
- case tab
- when active_tab
+ case file
+ when _(active_tab)
ret += "<li id='active_tab' >&nbsp;#{tab}&nbsp;</li> "
when ""
ret += "<li class='separator_tab' />"
@@ -57,35 +62,41 @@ class Dudle
ret
end
- def initialize(tabtitle, revision=nil)
+ def initialize(revision=nil)
@cgi = $cgi
- @tabtitle = tabtitle
+ @tab = File.basename($0)
+ @tab = "." if @tab == "index.cgi"
+
if File.exists?("data.yaml") && !File.stat("data.yaml").directory?
@is_poll = true
@basedir = ".."
+ GetText.bindtextdomain("dudle",:path => "#{@basedir}/locale/")
@revision = revision || VCS.revno
@table = YAML::load(VCS.cat(@revision, "data.yaml"))
@urlsuffix = File.basename(File.expand_path("."))
@title = @table.name
- @html = HTML.new("dudle - #{@title} - #{@tabtitle}")
- @html.header["Cache-Control"] = "no-cache"
# set-up tabs
@usertabs = [
- ["Poll","."],
- ["History","history.cgi"]
+ [_("Poll"),"."],
+ [_("History"),"history.cgi"]
]
@configtabs = [
- ["Edit Columns","edit_columns.cgi"],
- ["Invite Participants","invite_participants.cgi"],
- ["Access Control","access_control.cgi"],
- ["Overview","overview.cgi"]
+ [_("Edit Columns"),"edit_columns.cgi"],
+ [_("Invite Participants"),"invite_participants.cgi"],
+ [_("Access Control"),"access_control.cgi"],
+ [_("Overview"),"overview.cgi"]
]
- confignames = @configtabs.collect{|name,file| name}
- @is_config = confignames.include?(@tabtitle)
- @wizzardindex = confignames.index(@tabtitle) if @is_config
+ configfiles = @configtabs.collect{|name,file| file}
+ @is_config = configfiles.include?(@tab)
+ @wizzardindex = configfiles.index(@tab) if @is_config
+
+ @tabtitle = (@usertabs + @configtabs).collect{|title,file| title if file == @tab}.compact[0]
+ @html = HTML.new("dudle - #{@title} - #{@tabtitle}")
+ @html.header["Cache-Control"] = "no-cache"
else
@is_poll = false
@basedir = "."
+ GetText.bindtextdomain("dudle",:path => "#{@basedir}/locale/")
@title = "dudle"
@html = HTML.new(@title)
end
@@ -113,7 +124,7 @@ class Dudle
<div id='header2'></div>
<div id='header3'></div>
<div id='main'>
-#{tabs(@tabtitle)}
+#{tabs(@tab)}
<div id='content'>
<h1>#{@title}</h1>
HEAD
@@ -121,9 +132,9 @@ HEAD
def wizzard_nav
ret = "<div id='wizzard_navigation'><table><tr>"
- [["Previous",@wizzardindex == 0],
- ["Next",@wizzardindex >= @configtabs.size()-2],
- ["Finish",@wizzardindex == @configtabs.size()-1]].each{|button,disabled|
+ [[_("Previous"),@wizzardindex == 0],
+ [_("Next"),@wizzardindex >= @configtabs.size()-2],
+ [_("Finish"),@wizzardindex == @configtabs.size()-1]].each{|button,disabled|
ret += <<READY
<td>
<form method='post' action=''>
@@ -139,14 +150,14 @@ READY
end
def wizzard_redirect
- [["Previous",@wizzardindex-1],
- ["Next",@wizzardindex+1],
- ["Finish",@configtabs.size()-1]].each{|action,linkindex|
+ [[_("Previous"),@wizzardindex-1],
+ [_("Next"),@wizzardindex+1],
+ [_("Finish"),@configtabs.size()-1]].each{|action,linkindex|
if $cgi.include?(action)
@html.header["status"] = "REDIRECT"
@html.header["Cache-Control"] = "no-cache"
@html.header["Location"] = @configtabs[linkindex][1]
- @html << "All changes were saved sucessfully. <a href=\"#{@configtabs[linkindex][1]}\">Proceed!</a>"
+ @html << _("All changes were saved sucessfully.") + " <a href=\"#{@configtabs[linkindex][1]}\">" + _("Proceed!") + "</a>"
out
exit
end
diff --git a/edit_columns.rb b/edit_columns.rb
index cc41046..101ca29 100755
--- a/edit_columns.rb
+++ b/edit_columns.rb
@@ -27,11 +27,11 @@ revbeforeedit = VCS.revno
if $cgi.include?("undo_revision") && $cgi["undo_revision"].to_i < revbeforeedit
undorevision = $cgi["undo_revision"].to_i
- $d = Dudle.new("Edit Columns",undorevision)
+ $d = Dudle.new(undorevision)
comment = $cgi.include?("redo") ? "Redo changes" : "Reverted Poll"
$d.table.store("#{comment} to version #{undorevision}")
else
- $d = Dudle.new("Edit Columns")
+ $d = Dudle.new
end
$d.table.edit_column($cgi["columnid"],$cgi["new_columnname"],$cgi) if $cgi.include?("new_columnname")
@@ -41,10 +41,8 @@ $d.wizzard_redirect
revno = VCS.revno
-$d << <<HTML
-<h2>Add and Remove Columns</h2>
-#{$d.table.edit_column_htmlform($cgi["editcolumn"],revno)}
-HTML
+$d << "<h2>" + _("Add and Remove Columns") + "</h2>"
+$d << $d.table.edit_column_htmlform($cgi["editcolumn"],revno)
h = VCS.history
urevs = h.undorevisions
@@ -63,11 +61,11 @@ if urevs.max
coltitle,action = urevs.max.comment.scan(/^Column (.*) (added|deleted|edited)$/).flatten
case action
when "added"
- title["Undo"] = "Delete column #{coltitle}"
+ title["Undo"] = _("Delete column") + " #{coltitle}"
when "deleted"
- title["Undo"] = "Add column #{coltitle}"
+ title["Undo"] = _("Add column") + " #{coltitle}"
when "edited"
- title["Undo"] = "Edit column #{coltitle}"
+ title["Undo"] = _("Edit column") + " #{coltitle}"
end
curundorev = urevs.max.rev() +1 if rrevs.min
@@ -80,11 +78,11 @@ if rrevs.min
coltitle,action = rrevs.min.comment.scan(/^Column (.*) (added|deleted|edited)$/).flatten
case action
when "added"
- title["Redo"] = "Add column #{coltitle}"
- when "deleted"
- title["Redo"] = "Delete column #{coltitle}"
- when "edited"
- title["Redo"] = "Edit column #{coltitle}"
+ title["Redo"] = _("Add column") + " #{coltitle}"
+ when "deleted"
+ title["Redo"] = _("Delete column") + " #{coltitle}"
+ when "edited"
+ title["Redo"] = _("Edit column") + " #{coltitle}"
end
hidden["Redo"] = "<input type='hidden' name='redo'/>"
@@ -92,15 +90,16 @@ end
$d << <<UNDOREDOREADY
<div class='undo'>
- <table summary='Undo/Redo functionallity'>
+ <table>
<tr>
UNDOREDOREADY
+ localstr = {"Undo" => _("Undo"), "Redo" => _("Redo")}
["Undo","Redo"].each{|button|
$d << <<TD
<td>
<form method='post' action=''>
<div>
- <input type='submit' title='#{title[button]}' value='#{button}' #{disabled[button]} />
+ <input type='submit' title='#{title[button]}' value='#{localstr[button]}' #{disabled[button]} />
<input type='hidden' name='undo_revision' value='#{undorevision[button]}' />
#{hidden["common"]}
#{hidden[button]}
diff --git a/history.rb b/history.rb
index 9537191..cad05be 100755
--- a/history.rb
+++ b/history.rb
@@ -24,18 +24,19 @@ load "../dudle.rb"
if $cgi.include?("revision")
revno=$cgi["revision"].to_i
- versiontitle = "Poll of Version #{revno}"
- $d = Dudle.new("History",revno)
+ $d = Dudle.new(revno)
+ versiontitle = _("Poll of Version") + " #{revno}"
else
revno = VCS.revno
- versiontitle = "Current Poll (Version #{revno})"
- $d = Dudle.new("History")
+ $d = Dudle.new
+ versiontitle = _("Current Poll") + " (" + _("Version") + " #{revno})"
end
+historystr = _("History")
$d << <<HTML
<h2>#{versiontitle}</h2>
#{$d.table.to_html("",false)}
-<h2>History</h2>
+<h2>#{historystr}</h2>
<div id='history'>
#{$d.table.history_selectform($cgi.include?("revision") ? revno : nil, $cgi["history"])}
diff --git a/index.cgi b/index.cgi
index 6bd07aa..b5a2279 100755
--- a/index.cgi
+++ b/index.cgi
@@ -29,12 +29,12 @@ else
exit
end
-$d = Dudle.new("Home")
+$d = Dudle.new
if $cgi.include?("create_poll") && $cgi.include?("poll_url")
POLLTITLE=$cgi["create_poll"]
if POLLTITLE == ""
- createnotice = "Please enter a descriptive title."
+ createnotice = _("Please enter a descriptive title.")
else
if $cgi["poll_url"] == ""
if POLLTITLE =~ /^[\w\-_]*$/ && !File.exist?(POLLTITLE)
@@ -48,9 +48,9 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url")
if !(POLLURL =~ /^[\w\-_]*$/)
- createnotice = "Custom address may only contain letters, numbers, and dashes."
+ createnotice = _("Custom address may only contain letters, numbers, and dashes.")
elsif File.exist?(POLLURL)
- createnotice = "A Poll with this address already exists."
+ createnotice = _("A Poll with this address already exists.")
else Dir.mkdir(POLLURL)
Dir.chdir(POLLURL)
VCS.init
@@ -69,41 +69,50 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url")
$d.html.header["status"] = "REDIRECT"
$d.html.header["Cache-Control"] = "no-cache"
$d.html.header["Location"] = SITEURL + POLLURL+ "/edit_columns.cgi"
- $d << "The poll was created successfully. The link to your new poll is:<br /><a href=\"#{POLLURL}\">#{POLLURL}</a>"
+ $d << _("The poll was created successfully. The link to your new poll is:") + "<br /><a href=\"#{POLLURL}\">#{POLLURL}</a>"
end
end
end
unless $d.html.header["status"] == "REDIRECT"
+ $d << "<h2>"+ _("Create New Poll") + "</h2>"
+
+ titlestr = _("Title")
+ typestr = _("Type")
+ timepollstr = _("Event Schedule Poll (e.g. schedule a meeting)")
+ normalpollstr = _("Normal Poll (e.g. vote for what is the best coffee)")
+ customaddrstr = _("Custom address (optional)")
+ customaddrhintstr = _("May contain letters, numbers, and dashes.")
+
+ createstr = _("Create")
$d << <<CREATE
-<h2>Create New Poll</h2>
<form method='post' action='.'>
-<table class='settingstable' summary='Create a new Poll'>
+<table class='settingstable'>
<tr>
- <td class='label'><label for="poll_name">Title:</label></td>
+ <td class='label'><label for="poll_name">#{titlestr}:</label></td>
<td><input id="poll_name" size='40' type='text' name='create_poll' value="#{CGI.escapeHTML($cgi["create_poll"])}" /></td>
</tr>
<tr>
- <td class='label'>Type:</td>
+ <td class='label'>#{typestr}:</td>
<td>
<input id='chooseTime' type='radio' value='time' name='poll_type' checked='checked' />
- <label for='chooseTime'>Event Schedule Poll (e.g. schedule a meeting)</label>
+ <label for='chooseTime'>#{timepollstr}</label>
<br />
<input id='chooseNormal' type='radio' value='normal' name='poll_type' />
- <label for='chooseNormal'>Normal Poll (e.g. vote for what is the best coffee)</label>
+ <label for='chooseNormal'>#{normalpollstr}</label>
</td>
</tr>
<tr>
<td></td>
- <td style='padding-bottom:0.7ex'><input type='submit' value='Create' /></td>
+ <td style='padding-bottom:0.7ex'><input type='submit' value='#{createstr}' /></td>
</tr>
<tr>
- <td colspan='2' style='border-top:solid thin;padding-top:0.7ex;'>Custom address (optional):
- <span class='hint'>May contain letters, numbers, and dashes.</span></td>
+ <td colspan='2' style='border-top:solid thin;padding-top:0.7ex;'>#{customaddrstr}:
+ <span class='hint'>#{customaddrhintstr}</span></td>
</tr>
<tr>
- <td colspan='2'><label for="poll_url"><span class='hint'>#{SITEURL}</span></label><input id="poll_url" size='16' type='text' name='poll_url' value="#{CGI.escapeHTML($cgi["poll_url"])}" />
+ <td colspan='2'><label for="poll_url">#{SITEURL}</label><input id="poll_url" size='16' type='text' name='poll_url' value="#{CGI.escapeHTML($cgi["poll_url"])}" />
</td>
</tr>
CREATE
diff --git a/invite_participants.rb b/invite_participants.rb
index 3ce6d74..7399a3a 100755
--- a/invite_participants.rb
+++ b/invite_participants.rb
@@ -23,7 +23,7 @@ if __FILE__ == $0
load "../dudle.rb"
-$d = Dudle.new("Invite Participants")
+$d = Dudle.new
if $cgi.include?("add_participant")
$d.table.add_participant("",$cgi["add_participant"],{})
@@ -31,8 +31,9 @@ end
$d.wizzard_redirect
+inviteparticipantsstr = _("Invite Participants")
$d << <<TABLE
- <h2>Invite Participants</h2>
+ <h2>#{inviteparticipantsstr}</h2>
<form method='post' action=''>
#{$d.table.to_html("","invite")}
</form>
diff --git a/locale/de/dudle.po b/locale/de/dudle.po
new file mode 100644
index 0000000..a77ff43
--- /dev/null
+++ b/locale/de/dudle.po
@@ -0,0 +1,524 @@
+# ###########################################################################
+# Copyright 2009 Benjamin Kellermann #
+# #
+# This file is part of dudle. #
+# #
+# Dudle is free software: you can redistribute it and/or modify it under #
+# the terms of the GNU Affero General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# Dudle is distributed in the hope that it will be useful, but WITHOUT ANY #
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public #
+# License for more details. #
+# #
+# You should have received a copy of the GNU Affero General Public License #
+# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
+# ###########################################################################
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2010-01-20 16:30+0100\n"
+"PO-Revision-Date: 2010-01-20 16:40+0100\n"
+"Last-Translator: Benjamin Kellermann <Benjamin.Kellermann@tu-dresden.de>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Basepath: ../../\n"
+"X-Poedit-Language: German\n"
+"X-Poedit-Country: GERMANY\n"
+
+#: customize.cgi:31
+#: customize.rb:31
+msgid "Customize Personal Settings"
+msgstr "Persönliche Einstellungen anpassen"
+
+#: customize.cgi:32
+#: customize.rb:32
+msgid "You need cookies enabled in order to personalize your settings."
+msgstr "Ihr Browser muss cookies akzeptieren um persönliche Einstellungen dauerhaft vorzunehmen."
+
+#: customize.cgi:39
+#: customize.rb:39
+msgid "Current Setting"
+msgstr "Momentane Einstellung"
+
+#: customize.cgi:40
+#: customize.rb:40
+#: pollhead.rb:99
+msgid "Description"
+msgstr "Beschreibung"
+
+#: customize.cgi:57
+#: customize.rb:57
+msgid "Use special characters"
+msgstr "Benutze spezielle Zeichen"
+
+#: customize.cgi:57
+#: customize.rb:57
+msgid "Use this option if you see the characters in the parenthesis."
+msgstr "Benutzen Sie diese Einstellung, wenn Sie die Zeichen in den Klammern lesen können."
+
+#: customize.cgi:58
+#: customize.rb:58
+msgid "Use only normal strings"
+msgstr "Benutze nur gewöhnliche Zeichen."
+
+#: customize.cgi:58
+#: customize.rb:58
+msgid "Use this option if you have problems with some characters."
+msgstr "Benutzen Sie diese Einstellung, wenn Probleme mit der Darstellung einiger Zeichen auftreten."
+
+#: customize.cgi:61
+#: customize.rb:61
+msgid "Charset"
+msgstr "Zeichen"
+
+#: customize.cgi:70
+#: customize.rb:70
+msgid "Stylesheet"
+msgstr "Aussehen"
+
+#: customize.cgi:86
+#: customize.rb:86
+msgid "Default Username"
+msgstr "Voreingestellter Teilnehmername"
+
+#: customize.cgi:87
+#: access_control.rb:74
+#: customize.rb:87
+msgid "Username:"
+msgstr "Teilnehmername:"
+
+#: customize.cgi:111
+#: customize.rb:111
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: customize.cgi:121
+#: access_control.rb:121
+#: customize.rb:121
+#: poll.rb:201
+msgid "Save"
+msgstr "Speichern"
+
+#: customize.cgi:124
+#: access_control.rb:117
+#: customize.rb:124
+#: delete_poll.rb:98
+#: poll.rb:218
+msgid "Delete"
+msgstr "Löschen"
+
+#: index.cgi:37
+msgid "Please enter a descriptive title."
+msgstr "Bitte geben Sie einen Titel für die Umfrage ein."
+
+#: index.cgi:51
+msgid "Custom address may only contain letters, numbers, and dashes."
+msgstr "Die spezielle eigene URL darf nur Buchstaben, Zahlen, Bindestrich und Unterstrich enthalten."
+
+#: index.cgi:53
+msgid "A Poll with this address already exists."
+msgstr "Eine Umfrage mit dieser URL existiert bereits."
+
+#: index.cgi:72
+msgid "The poll was created successfully. The link to your new poll is:"
+msgstr "Die Umfrage wurde erfolgreich erstellt. Die Adresse der Umfrage lautet:"
+
+#: index.cgi:79
+msgid "Create New Poll"
+msgstr "Neue Umfrage erstellen"
+
+#: index.cgi:81
+msgid "Title"
+msgstr "Titel"
+
+#: index.cgi:82
+msgid "Type"
+msgstr "Typ"
+
+#: index.cgi:83
+msgid "Event Schedule Poll (e.g. schedule a meeting)"
+msgstr "Nach einer Zeit fragen (z.B. einen Besprechungstermin finden)"
+
+#: index.cgi:84
+msgid "Normal Poll (e.g. vote for what is the best coffee)"
+msgstr "Normale Umfrage (z.B. eine Umfrage über die beste Kaffeesorte)"
+
+#: index.cgi:85
+msgid "Custom address (optional)"
+msgstr "eigene URL (optional)"
+
+#: index.cgi:86
+msgid "May contain letters, numbers, and dashes."
+msgstr "Kann Buchstaben, Zahlen, Bindestriche und Unterstriche enthalten."
+
+#: index.cgi:88
+msgid "Create"
+msgstr "Erstellen"
+
+#: access_control.rb:87
+msgid "Password"
+msgstr "Passwort"
+
+#: access_control.rb:88
+msgid "repeat"
+msgstr "wiederholen"
+
+#: access_control.rb:114
+msgid "You have to remove the participant user before you can remove the administrator."
+msgstr "Der Benutzer „participant“ muss entfernt werden, bevor Sie den Administrator entfernen können."
+
+#: access_control.rb:139
+msgid "Only letters and digits are allowed in the username."
+msgstr "Der Benutzername darf nur Buchstaben und Zahlen enthalten."
+
+#: access_control.rb:141
+msgid "Passwords did not match."
+msgstr "Die Passwörter stimmen nicht überein."
+
+#: access_control.rb:174
+msgid "Change Access Control Settings"
+msgstr "Einstellungen der Zugriffskontrolle"
+
+#: access_control.rb:178
+msgid "not activated"
+msgstr "nicht aktiviert"
+
+#: access_control.rb:180
+msgid "Activate"
+msgstr "Aktivieren"
+
+#: access_control.rb:183
+msgid "will be activated when at least an admin user is configured"
+msgstr "wird aktiviert, wenn ein Administrator (Benutzername: „admin“) konfiguriert wurde"
+
+#: access_control.rb:185
+msgid "Deactivate"
+msgstr "Deaktivieren"
+
+#: access_control.rb:187
+msgid "activated"
+msgstr "aktiviert"
+
+#: access_control.rb:188
+msgid "You have to remove all users before you can deactivate the access control settings."
+msgstr "Sie müssen alle Benutzer entfernen, bevor Sie die Zugriffskontrolle deaktivieren können."
+
+#: access_control.rb:192
+msgid "You will be asked for the password you entered here after pressing save!"
+msgstr "Nach dem Speichern werden Sie nach dem Benutzernamen und diesem Passwort gefragt!"
+
+#: access_control.rb:195
+msgid "The user ‘admin’ has access to the vote as well as the configuration interface."
+msgstr "Der Benutzer „admin“ hat sowohl zur Abstimmungs- als auch zur Konfigurationsoberfläche Zugriff."
+
+#: access_control.rb:201
+msgid "The user ‘participant’ has only access to the vote interface."
+msgstr "Der Benutzer „participant“ hat nur zur Abstimmungsoberfläche Zugriff."
+
+#: access_control.rb:207
+msgid "Access control:"
+msgstr "Zugriffskontrolle:"
+
+#: delete_poll.rb:28
+msgid "Yes, I know what I am doing!"
+msgstr "Ja, ich weiß was ich mache!"
+
+#: delete_poll.rb:29
+msgid "I hate these stupid entry fields."
+msgstr "Ich hasse diese sinnlosen Eingabefelder."
+
+#: delete_poll.rb:30
+msgid "I am aware of the consequences."
+msgstr "Ich bin mir über die Konsequenzen bewusst."
+
+#: delete_poll.rb:31
+msgid "Please delete this poll."
+msgstr "Bitte lösche diese Umfrage."
+
+#: delete_poll.rb:39
+msgid "The poll was deleted successfully!"
+msgstr "Die Umfrage wurde erfolgreich gelöscht!"
+
+#: delete_poll.rb:40
+msgid "If this was done by accident, please contact the administrator of the system. The poll can be recovered for an indeterministic amount of time, maybe it is already to late."
+msgstr "Wenn das ein Versehen war, kontaktieren Sie bitte umgehend den Administrator des Systems. Die Umfrage kann für einen unvorhersehbaren Zeitraum wiederhergestellt werden, vielleicht ist jetzt schon zu spät."
+
+#: delete_poll.rb:41
+msgid "Things you can do now are"
+msgstr "Dinge, die Sie jetzt machen können:"
+
+#: delete_poll.rb:42
+msgid "Return to dudle home and Schedule a new Poll"
+msgstr "Zurück zur dudle Hauptseite um eine neue Umfrage zu erstellen"
+
+#: delete_poll.rb:43
+msgid "Browse Wikipedia"
+msgstr "bei Wikipedia stöbern"
+
+#: delete_poll.rb:44
+msgid "Search something with Google"
+msgstr "Etwas mit google suchen"
+
+#: delete_poll.rb:70
+msgid "To delete the poll, you have to type:"
+msgstr "Um diese Umfrage zu löschen müssen Sie folgenden Satz eingeben:"
+
+#: delete_poll.rb:80
+msgid "but you typed:"
+msgstr "Ihre Eingabe lautete aber:"
+
+#: delete_poll.rb:94
+msgid "Delete this Poll"
+msgstr "Diese Umfrage löschen"
+
+#: delete_poll.rb:95
+msgid "You want to delete the poll named"
+msgstr "Sie wollen die Umfrage mit folgendem Namen löschen:"
+
+#: delete_poll.rb:96
+msgid "This is an irreversible action!"
+msgstr "Das Löschen der gesamten Umfrage ist unwiederrufbar!"
+
+#: delete_poll.rb:97
+msgid "If you are sure in what you are doing, please type into the form"
+msgstr "Wenn Sie sich sicher sind, dann geben Sie bitte nachfolgenden Satz ein:"
+
+#: delete_poll.rb:97
+msgid "“"
+msgstr "„"
+
+#: delete_poll.rb:97
+msgid "”"
+msgstr "“"
+
+#: dudle.rb:41
+msgid "Home"
+msgstr "Hauptseite"
+
+#: dudle.rb:47
+msgid "Delete Poll"
+msgstr "Lösche Umfrage"
+
+#: dudle.rb:50
+msgid "Customize"
+msgstr "Personalisieren"
+
+#: dudle.rb:80
+msgid "Poll"
+msgstr "Umfrage"
+
+#: dudle.rb:81
+#: history.rb:35
+msgid "History"
+msgstr "Versionen"
+
+#: dudle.rb:84
+msgid "Edit Columns"
+msgstr "Bearbeite Spalten"
+
+#: dudle.rb:85
+#: invite_participants.rb:34
+msgid "Invite Participants"
+msgstr "Teilnehmer einladen"
+
+#: dudle.rb:86
+msgid "Access Control"
+msgstr "Zugriffskontrolle"
+
+#: dudle.rb:87
+msgid "Overview"
+msgstr "Übersicht"
+
+#: dudle.rb:135
+#: dudle.rb:153
+msgid "Previous"
+msgstr "Zurück"
+
+#: dudle.rb:136
+#: dudle.rb:154
+msgid "Next"
+msgstr "Weiter"
+
+#: dudle.rb:137
+#: dudle.rb:155
+msgid "Finish"
+msgstr "Fertig"
+
+#: dudle.rb:160
+msgid "All changes were saved sucessfully."
+msgstr "Alle Änderungen wurden erfolgreich gespeichert."
+
+#: dudle.rb:160
+msgid "Proceed!"
+msgstr "Weiter"
+
+#: edit_columns.rb:44
+msgid "Add and Remove Columns"
+msgstr "Spalten hinzufügen oder entfernen"
+
+#: edit_columns.rb:64
+#: edit_columns.rb:83
+msgid "Delete column"
+msgstr "Lösche Spalte"
+
+#: edit_columns.rb:66
+#: edit_columns.rb:81
+msgid "Add column"
+msgstr "Füge Spalte hinzu"
+
+#: edit_columns.rb:68
+#: edit_columns.rb:85
+msgid "Edit column"
+msgstr "Bearbeite Spalte"
+
+#: edit_columns.rb:96
+msgid "Undo"
+msgstr "Rückgängig"
+
+#: edit_columns.rb:96
+msgid "Redo"
+msgstr "Wiederherstellen"
+
+#: history.rb:28
+msgid "Poll of Version"
+msgstr "Umfrage der Version"
+
+#: history.rb:32
+msgid "Current Poll"
+msgstr "Aktuelle Umfrage"
+
+#: history.rb:32
+#: log.rb:111
+msgid "Version"
+msgstr "Version"
+
+#: log.rb:111
+msgid "Date"
+msgstr "Datum"
+
+#: log.rb:111
+msgid "Comment"
+msgstr "Kommentar"
+
+#: overview.rb:31
+msgid "The link to your poll is:"
+msgstr "Die URL zu ihrer Umfrage ist:"
+
+#: overview.rb:33
+msgid "Send this link via email..."
+msgstr "Diese URL per E-Mail..."
+
+#: overview.rb:34
+msgid "To the Vote interface"
+msgstr "Zur Abstimmung"
+
+#: poll.rb:76
+msgid "Edit user"
+msgstr "Bearbeite Teilnehmer"
+
+#: poll.rb:105
+msgid "total"
+msgstr "Summe"
+
+#: poll.rb:146
+msgid "Invite"
+msgstr "Einladen"
+
+#: poll.rb:198
+msgid "Save Changes"
+msgstr "Speichern"
+
+#: poll.rb:199
+msgid "Delete User"
+msgstr "Lösche Teilnehmer"
+
+#: poll.rb:212
+msgid "Comments"
+msgstr "Kommentare"
+
+#: poll.rb:214
+msgid "said on"
+msgstr "sagte am"
+
+#: poll.rb:236
+msgid "says"
+msgstr "sagt"
+
+#: poll.rb:237
+msgid "Submit Comment"
+msgstr "Sende Kommentar"
+
+#: poll.rb:254
+msgid "Show history items:"
+msgstr "Zeige nur folgende Versionen:"
+
+#: poll.rb:261
+msgid "All"
+msgstr "Alle"
+
+#: poll.rb:262
+msgid "Participant related"
+msgstr "Teilnehmer betreffend"
+
+#: poll.rb:263
+msgid "Column related"
+msgstr "Spalten betreffend"
+
+#: poll.rb:264
+msgid "Comment related"
+msgstr "Kommentare betreffend"
+
+#: poll.rb:265
+msgid "Access Control related"
+msgstr "Zugriffskontrolle betreffend"
+
+#: poll.rb:271
+msgid "Update"
+msgstr "Aktualisieren"
+
+#: pollhead.rb:62
+msgid "Name"
+msgstr "Name"
+
+#: pollhead.rb:86
+#: timepollhead.rb:190
+msgid "Last Edit"
+msgstr "Letzte Änderung"
+
+#: pollhead.rb:98
+msgid "Columntitle"
+msgstr "Spaltenüberschrift"
+
+#: pollhead.rb:100
+msgid "Add/Edit Column"
+msgstr "Spalte bearbeiten/hinzufügen"
+
+#: pollhead.rb:101
+msgid "Preview"
+msgstr "Vorschau"
+
+#: timepollhead.rb:213
+msgid "Click on the dates to add or remove columns."
+msgstr "Klicken Sie auf ein Datum um es der Umfrage hinzuzufügen."
+
+#: timepollhead.rb:282
+msgid "Optional:"
+msgstr "Optional:"
+
+#: timepollhead.rb:283
+msgid "Enter a concrete value as start time."
+msgstr "Geben Sie eine Zeit für ein Datum ein."
+
+#: timepollhead.rb:356
+msgid "Add"
+msgstr "Hinzufügen"
+
+#: timepollhead.rb:357
+msgid "e.g.: 09:30, morning, afternoon"
+msgstr "z.B.: 9:30, morgens, abends"
+
diff --git a/log.rb b/log.rb
index 368440c..6780027 100644
--- a/log.rb
+++ b/log.rb
@@ -107,7 +107,8 @@ class Log
@log.sort!
end
def to_html(unlinkedrevision,history)
- ret = "<table summary='Historytable' ><tr><th>Version</th><th>Date</th><th>Comment</th></tr>"
+ ret = "<table><tr><th>"
+ ret += _("Version") + "</th><th>" + _("Date") + "</th><th>" + _("Comment") + "</th></tr>"
self.reverse_each{|l|
ret += l.to_html(unlinkedrevision != l.rev,history)
}
diff --git a/overview.rb b/overview.rb
index 3355ae3..0286efa 100755
--- a/overview.rb
+++ b/overview.rb
@@ -23,17 +23,22 @@ if __FILE__ == $0
load "../dudle.rb"
-$d = Dudle.new("Overview")
+$d = Dudle.new
$d.wizzard_redirect
+
+$d << _("The link to your poll is:")
+
+mailstr = _("Send this link via email...")
+nextstr = _("To the Vote interface")
+
$d << <<END
-The link to your poll is:
<pre>#{SITEURL}</pre>
-<a href='mailto:?subject=link%20to%20dudle%20poll%20about%20#{CGI.escapeHTML(CGI.escape($d.title).gsub("+","%20"))}&amp;body=#{SITEURL}'>Send this link via email...</a>
+<a href='mailto:?subject=link%20to%20dudle%20poll%20about%20#{CGI.escapeHTML(CGI.escape($d.title).gsub("+","%20"))}&amp;body=#{SITEURL}'>#{mailstr}</a>
<form method='get' action='.'>
<div style='margin-top:1ex'>
- <input type='submit' value='To the Vote interface' />
+ <input type='submit' value='#{nextstr}' />
</div>
</form>
END
diff --git a/participate.rb b/participate.rb
index df10d30..1218502 100755
--- a/participate.rb
+++ b/participate.rb
@@ -22,7 +22,7 @@
if __FILE__ == $0
load "../dudle.rb"
-$d = Dudle.new("Poll")
+$d = Dudle.new
if $cgi.include?("add_participant")
if $cgi.include?("delete_participant")
diff --git a/poll.rb b/poll.rb
index 3116af6..e2c410e 100644
--- a/poll.rb
+++ b/poll.rb
@@ -73,7 +73,7 @@ class Poll
else
ret += "<tr class='participantrow'>\n"
ret += "<td class='name'>"
- ret += "<a title='Edit user #{CGI.escapeHTML(participant)}' href=\"?edituser=#{CGI.escapeHTML(CGI.escape(participant))}\">" if showparticipation
+ ret += "<a title='" + _("Edit user") + " #{CGI.escapeHTML(participant)}' href=\"?edituser=#{CGI.escapeHTML(CGI.escape(participant))}\">" if showparticipation
ret += participant
ret += "<span class='edituser'> <sup>#{EDIT}</sup></span></a>" if showparticipation
ret += "</td>\n"
@@ -102,7 +102,7 @@ class Poll
ret += invite_to_html if invite
# SUMMARY
- ret += "<tr id='summary'><td class='name'>total</td>\n"
+ ret += "<tr id='summary'><td class='name'>" + _("total") + "</td>\n"
@head.columns.each{|column|
yes = 0
undecided = 0
@@ -143,13 +143,14 @@ class Poll
end
def invite_to_html
+ invitestr = _("Invite")
ret = <<INVITE
<tr id='add_participant'>
<td class='name'>
<input size='16' type='text' name='add_participant' />
</td>
<td class='checkboxes' colspan='#{@head.col_size + 1}'>
- <input type='submit' value='Invite' />
+ <input type='submit' value='#{invitestr}' />
</td>
</tr>
INVITE
@@ -175,7 +176,8 @@ INVITE
@head.columns.each{|column|
ret += "<td class='checkboxes'><table summary='Input for one column' class='checkboxes'>"
[[YES, YESVAL],[NO, NOVAL],[MAYBE, MAYBEVAL]].each{|valhuman, valbinary|
- ret += "<tr class='input-#{valbinary}'>
+ ret += <<TR
+ <tr class='input-#{valbinary}'>
<td class='input-#{valbinary}'>
<input type='radio'
value='#{valbinary}'
@@ -186,16 +188,17 @@ INVITE
<td class='input-#{valbinary}'>
<label for=\"add_participant_checked_#{CGI.escapeHTML(column.to_s.gsub(" ","_").gsub("+","_"))}_#{valbinary}\">#{valhuman}</label>
</td>
- </tr>"
+ </tr>
+TR
}
ret += "</table></td>"
}
ret += "<td class='date'>"
if @data.include?(edituser)
- ret += "<input type='submit' value='Save Changes' />"
- ret += "<br /><input style='margin-top:1ex' type='submit' name='delete_participant' value='Delete User' />"
+ ret += "<input type='submit' value='" + _("Save Changes") + "' />"
+ ret += "<br /><input style='margin-top:1ex' type='submit' name='delete_participant' value='" + _("Delete User") + "' />"
else
- ret += "<input type='submit' value='Save' />"
+ ret += "<input type='submit' value='" + _("Save") + "' />"
end
ret += "</td>\n"
@@ -206,19 +209,21 @@ INVITE
def comment_to_html
ret = "<div id='comments'>"
- ret += "<h2>Comments</h2>"
+ ret += "<h2>" + _("Comments") + "</h2>"
+ saidstr = _("said on")
unless @comment.empty?
@comment.each_with_index{|c,i|
time,name,comment = c
+ deletestr = _("Delete")
ret += <<COMMENT
<form method='post' action='.'>
<div class='textcolumn'>
<h3 class='comment'>
- #{name} said on #{time.strftime("%d.%m, %H:%M")}
+ #{name} #{saidstr} #{time.strftime("%d.%m., %H:%M")}
<input type='hidden' name='delete_comment' value='#{i}' />
&nbsp;
- <input class='delete_comment_button' type='submit' value='delete' />
+ <input class='delete_comment_button' type='submit' value='#{deletestr}' />
</h3>
#{comment}
</div>
@@ -228,13 +233,15 @@ COMMENT
end
# ADD COMMENT
+ saysstr = _("says")
+ submitstr = _("Submit Comment")
ret += <<ADDCOMMENT
<form method='post' action='.'>
<div class='comment' id='add_comment'>
- <input value='Anonymous' type='text' name='commentname' size='9' /> says&nbsp;
+ <input value='Anonymous' type='text' name='commentname' size='9' /> #{saysstr}&nbsp;
<br />
<textarea cols='50' rows='7' name='comment' ></textarea>
- <br /><input type='submit' value='Submit Comment' />
+ <br /><input type='submit' value='#{submitstr}' />
</div>
</form>
ADDCOMMENT
@@ -244,24 +251,26 @@ ADDCOMMENT
end
def history_selectform(revision, selected)
+ showhiststr = _("Show history items:")
ret = <<FORM
<form method='get' action=''>
<div>
- Show history items:
+ #{showhiststr}
<select name='history'>
FORM
- [["","All"],
- ["participants","Participant related"],
- ["columns","Column related"],
- ["comments","Comment related"],
- ["ac","Access Control related"]
+ [["",_("All")],
+ ["participants",_("Participant related")],
+ ["columns",_("Column related")],
+ ["comments",_("Comment related")],
+ ["ac",_("Access Control related")]
].each{|value,opt|
ret += "<option value='#{value}' #{selected == value ? "selected='selected'" : ""} >#{opt}</option>"
}
ret += "</select>"
ret += "<input type='hidden' name='revision' value='#{revision}' />" if revision
+ updatestr = _("Update")
ret += <<FORM
- <input type='submit' value='Update' />
+ <input type='submit' value='#{updatestr}' />
</div>
</form>
FORM
diff --git a/pollhead.rb b/pollhead.rb
index dc2d12d..c764a90 100644
--- a/pollhead.rb
+++ b/pollhead.rb
@@ -59,7 +59,7 @@ class PollHead
SORTSYMBOL
end
ret = "<tr>"
- ret += "<th><a href='?sort=name'>Name#{sortsymb(scols,"name")}</span></a></th>\n" unless showeditbuttons
+ ret += "<th><a href='?sort=name'>" + _("Name") + " #{sortsymb(scols,"name")}</span></a></th>\n" unless showeditbuttons
@data.sort.each{|columntitle,columndescription|
ret += "<th"
ret += " id='active' " if activecolumn == columntitle
@@ -83,7 +83,7 @@ EDITDELETE
end
ret += "</th>"
}
- ret += "<th><a href='?'>Last Edit#{sortsymb(scols,"timestamp")}</a></th>\n" unless showeditbuttons
+ ret += "<th><a href='?'>" + _("Last Edit") + " #{sortsymb(scols,"timestamp")}</a></th>\n" unless showeditbuttons
ret += "</tr>\n"
ret
end
@@ -95,20 +95,24 @@ EDITDELETE
title = CGI.escapeHTML(title)
hiddeninput = "<input type='hidden' name='columnid' value=\"#{title}\" />"
end
+ columntitlestr = _("Columntitle")
+ descriptionstr = _("Description")
+ addeditstr = _("Add/Edit Column")
+ previewstr = _("Preview")
return <<END
<form method='post' action=''>
<div>
- <label for='columntitle'>Columntitle: </label>
+ <label for='columntitle'>#{columntitlestr}: </label>
<input id='columntitle' size='16' type='text' value="#{title}" name='new_columnname' />
- <label for='columndescription'>Description: </label>
+ <label for='columndescription'>#{descriptionstr}: </label>
<input id='columndescription' size='30' type='text' value="#{description}" name='columndescription' />
<input type='hidden' name='undo_revision' value='#{revision}' />
#{hiddeninput}
- <input type='submit' value='Add/Edit Column' />
+ <input type='submit' value='#{addeditstr}' />
</div>
</form>
-<h2>Preview</h2>
-<table summary='Preview poll head'>
+<h2>#{previewstr}</h2>
+<table>
#{to_html([],true,activecolumn)}
</table>
diff --git a/timepollhead.rb b/timepollhead.rb
index 2ff5266..f9df5ed 100644
--- a/timepollhead.rb
+++ b/timepollhead.rb
@@ -176,7 +176,7 @@ class TimePollHead
ret += "<th class='invisible' /></tr><tr><th class='invisible'></th>"
head_count("%Y-%m-%d",false).each{|title,count|
- ret += "<th colspan='#{count}'>#{Date.parse(title).strftime("%a, %d")}</th>\n"
+ ret += "<th colspan='#{count}'>#{Date.parse(title).strftime('%a, %d')}</th>\n"
}
def sortsymb(scols,col)
@@ -187,7 +187,7 @@ class TimePollHead
@data.sort.each{|date|
ret += "<th><a title='#{date}' href='?sort=#{CGI.escape(date.to_s)}'>#{date.time_to_s} #{sortsymb(scols,date.to_s)}</a></th>\n"
}
- ret += "<th><a href='?'>Last Edit #{sortsymb(scols,"timestamp")}</a></th>\n</tr>\n"
+ ret += "<th><a href='?'>" + _("Last Edit") + " #{sortsymb(scols,"timestamp")}</a></th>\n</tr>\n"
ret
end
@@ -210,11 +210,11 @@ class TimePollHead
else
startdate = Date.parse("#{Date.today.year}-#{Date.today.month}-1")
end
+ hintstr = _("Click on the dates to add or remove columns.")
ret = <<END
-
<table style='width:100%' summary='edit column'><tr><td style="vertical-align:top">
<div id='AddRemoveColumndaysDescription' class='shorttextcolumn'>
-Click on the dates to add or remove columns.
+#{hintstr}
</div>
<table class='calendarday' summary='The day to vote for.'><tr>
END
@@ -232,7 +232,7 @@ END
END
end
ret += navi(MONTHBACK,startdate,revision)
- ret += "<th colspan='3'>#{startdate.strftime("%b %Y")}</th>"
+ ret += "<th colspan='3'>#{startdate.strftime('%b %Y')}</th>"
ret += navi(MONTHFORWARD,startdate,revision)
ret += "</tr><tr>\n"
@@ -279,10 +279,12 @@ END
###########################
ret += "<td style='vertical-align:top'>"
if col_size > 0
- ret += <<END
-<div class='shorttextcolumn'>
-Optional:<br/>
-Enter a concrete value as start time.
+ optstr = _("Optional:")
+ hintstr = _("Enter a concrete value as start time.")
+ ret += <<END
+<div id='ConcreteColumndaysDescription' class='shorttextcolumn'>
+#{optstr}<br/>
+#{hintstr}
</div>
<table class='calendarday' summary='The concrete timeslot'>
<tr>
@@ -296,7 +298,7 @@ END
ret += "</tr><tr>"
head_count("%Y-%m-%d",true).each{|title,count|
- ret += "<th>#{Date.parse(title).strftime("%a, %d")}</th>\n"
+ ret += "<th>#{Date.parse(title).strftime('%a, %d')}</th>\n"
}
ret += "</tr>"
@@ -351,9 +353,11 @@ END
if @data.include?(TimeString.new(d,nil))
ret += "<input type='hidden' name='columnid' value='#{TimeString.new(d,nil).to_s}' />"
end
+ addstr = _("Add")
+ hintstr = _("e.g.: 09:30, morning, afternoon")
ret += <<END
- <input type="text" name='columntime' title='e.g.: 09:30, morning, afternoon' style="width: 7ex" /><br />
- <input type="submit" value="Add" style="width: 100%" />
+ <input type="text" name='columntime' title='#{hintstr}' style="max-width: 10ex" /><br />
+ <input type="submit" value="#{addstr}" style="width: 100%" />
</div>
</form>
</td>