From 93a2b996386c989bd28013332086f7489e7c7b52 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Wed, 20 Jan 2010 16:44:00 +0100 Subject: added localization support + german language --- access_control.rb | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'access_control.rb') 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 + passwdstr = _("Password") + repeatstr = _("repeat") 2.times{|i| ret += < - +
Username:#{usernamestr} #{userarray[0]} @@ -83,10 +84,12 @@ def createform(userarray,hint,acusers)
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 += "
You have to remove the participant user before you can remove the administrator.
" + ret += "
" + _("You have to remove the participant user before you can remove the administrator.") + "
" else - ret += "" + ret += "" + ret += "" end else - ret += "" + ret += "" + ret += "" end ret += <" elsif $cgi["ac_password0"] != $cgi["ac_password1"] - usercreatenotice = "
Passwords did not match.
" + usercreatenotice = "
" + _("Passwords did not match.") + "
" 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 << "

Change Access Control Settings

" +$d.html << "

" + _("Change Access Control Settings") + "

" if acusers.empty? && $cgi["ac_activate"] != "Activate" - acstatus = ["red","not activated"] - acswitchbutton = "" + acstatus = ["red",_("not activated")] + acswitchbutton = "" + acswitchbutton += "" else if acusers.empty? - acstatus = ["blue","will be activated when at least an admin user is configured"] - acswitchbutton = "" + acstatus = ["blue",_("will be activated when at least an admin user is configured")] + acswitchbutton = "" + acswitchbutton += "" else - acstatus = ["green", "activated"] - acswitchbutton = "
You have to remove all users before you can deactivate the access control settings.
" + acstatus = ["green", _("activated")] + acswitchbutton = "
" + _("You have to remove all users before you can deactivate the access control settings.") + "
" 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 << < - +
- Access control: + #{acstr} #{acstatus[1]} -- cgit v1.2.3