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 --- customize.rb | 59 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'customize.rb') 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 << <Customize Personal Settings -You need cookies enabled in order to personalize your settings. -END +$d << "

" + _("Customize Personal Settings") + "

" +$d << _("You need cookies enabled in order to personalize your settings.") -def choosetable(tablesummary, options, cursetting) +def choosetable(options, cursetting) ret = < + - - - HEAD + ret += "" + ret += "" + ret += "" options.each{|description,href,title| selected = href == cursetting ret += "
Current SettingDescription
" + _("Current Setting") + "" + _("Description") + "
" @@ -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

-#{choosetable("Charset settings",a,$USEUTF ? "utf" : "ascii")} - -CHARSET +$d << "
" +$d << "

" + _("Charset")+ "

" +$d << choosetable(a,$USEUTF ? "utf" : "ascii") +$d << "
" 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 << < -

Stylesheet

-#{choosetable("Stylesheet settings",$d.css.collect{|href| [href.scan(/([^\/]*)\.css/).flatten[0],"css=#{href}"]},"css=#{css}")} - -CSS +$d << "
" +$d << "

" + _("Stylesheet") + "

" +$d << choosetable($d.css.collect{|href| [href.scan(/([^\/]*)\.css/).flatten[0],"css=#{href}"]},"css=#{css}") +$d << "
" username = $cgi.cookies["username"][0] @@ -88,14 +82,17 @@ elsif $cgi.include?("username") end + +defaultuserstr = _("Default Username") +usernamestr = _("Username:") $d << < -

Default Username

+

#{defaultuserstr}

- - +
+
- + CHARSET @@ -110,8 +107,8 @@ if username && !$cgi.include?("edit")
- CHARSET + $d << "" else $d << < @@ -120,11 +117,11 @@ else
- CHARSET + $d << "" end -$d.html << "" if username +$d.html << "" if username $d << < -- cgit v1.2.3