<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/13207" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2007-09-07T12:55:06-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/13207</id>

		<entry>
		<author><name><![CDATA[Foxman]]></name></author>
		<updated>2007-09-07T12:55:06-04:00</updated>

		<published>2007-09-07T12:55:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75781#p75781</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75781#p75781"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75781#p75781"><![CDATA[
About the month translation [lindex.. works only for 8 months <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>i'll try the [string Map... now<br><br>See yah <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8589">Foxman</a> — Fri Sep 07, 2007 12:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2007-03-12T14:54:08-04:00</updated>

		<published>2007-03-12T14:54:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71191#p71191</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71191#p71191"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71191#p71191"><![CDATA[
Thanks Foxman, it works  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Mon Mar 12, 2007 2:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Foxman]]></name></author>
		<updated>2007-03-11T14:05:27-04:00</updated>

		<published>2007-03-11T14:05:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71167#p71167</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71167#p71167"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71167#p71167"><![CDATA[
Hi Fly,<br><br><br>You have to look for the line<div class="codebox"><p>Code: </p><pre><code>set sholine "$tclr(-d10) [string toupper [strftime %A $lut]]S Top 10 - "</code></pre></div>And add the new code/change old code like this<br><div class="codebox"><p>Code: </p><pre><code>       set nameOfDay [lindex {Domingo Lunes Martes Miercoles Jueves Viernes Sabado} [clock format $lut -format %w]]        set sholine "$tclr(-d10) [string toupper $nameOfDay]S Top 10 - "       if {$t2(history)=="1" &amp;&amp; $lcnt&gt;"10"} {  set lcnt 10  }       if {$t2(history)&gt;"1" &amp;&amp; $lcnt&gt;"11"} {         if {$lcnt&gt;"20"} {  set lcnt 20  }         set sholin2 "$tclr(-d10) [string toupper $nameOfDay]S Top 11-20: - "  }</code></pre></div>Then it will work, and you can do the same for the Months<br><br>Further in the script you have to do it again for [strftime %A $dut], [strftime %B $dut]<br><br>Good luck <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>ps: you have to do it like this because $lut does only exist in that part of the script, and it shouldn't be unixtime (that is how i understand it. And it works for me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8589">Foxman</a> — Sun Mar 11, 2007 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2007-03-11T13:27:43-04:00</updated>

		<published>2007-03-11T13:27:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71163#p71163</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71163#p71163"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71163#p71163"><![CDATA[
Hi,<br><br>I tried to do the same in spanish, so:<br><blockquote class="uncited"><div>.tcl set lut [unixtime]<br>Tcl: 1173633454<br><br>.tcl set nameOfDay [lindex {Domingo Lunes Martes Miercoles Jueves Viernes Sabado} [clock format $lut -format %w]]<br>Tcl: Domingo<br><br>.tcl set nameOfMonth [lindex {Diciembre Enero Febrero Marzo Abril Mayo Junio Julio Agosto Septiembre Octubre Noviembre} [clock format $lut -format %m]]<br>Tcl: Marzo</div></blockquote>Nothing changed in the script, it still displays weekdays and months in English.<br><br>I didn't change anything in the script, dunno what should I add exactly, and where... I just made what I wrote above (in the console)  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Sun Mar 11, 2007 1:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Foxman]]></name></author>
		<updated>2007-03-08T19:24:19-04:00</updated>

		<published>2007-03-08T19:24:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71109#p71109</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71109#p71109"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71109#p71109"><![CDATA[
Thanks a lot all, it worked! now i can do the same for MONTHS. %B<br><br>you guy's are great!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8589">Foxman</a> — Thu Mar 08, 2007 7:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-03-08T19:19:50-04:00</updated>

		<published>2007-03-08T19:19:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71108#p71108</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71108#p71108"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71108#p71108"><![CDATA[
<blockquote class="uncited"><div>.tcl set lut [unixtime]<br>Tcl: 1173395909<br><br>.tcl set nameOfDay [string map {<br>Sunday Zondag<br>Monday Maandag<br>Tuesday Dinsdag<br>Wednesday Woensdag<br>Thursday Donderdag<br>Friday Vrijdag<br>Saturday Zaterdag} [strftime %A $lut]]<br>Tcl: Vrijdag<br><br>.tcl set nameOfDay [lindex {Zondag Maandag Dinsdag Woensdag Donderdag Vrijdag Zaterdag} [clock format $lut -format %w]]<br>Tcl: Vrijdag</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Mar 08, 2007 7:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Foxman]]></name></author>
		<updated>2007-03-08T15:43:32-04:00</updated>

		<published>2007-03-08T15:43:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71102#p71102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71102#p71102"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71102#p71102"><![CDATA[
I take it:<br><br>If I would use:<div class="codebox"><p>Code: </p><pre><code>set nameOfDay [string map {    Sunday    Zondag    Monday    Maandag    Tuesday   Dinsdag    Wednesday Woensdag    Thursday  Donderdag    Friday    Vrijdag    Saturday  Zaterdag } [strftime %A $lut]]</code></pre></div>I should replace<br>[strftime %A $lut]  for $nameOfDay<br>in the script?<br><br>The actual line in the script is:<div class="codebox"><p>Code: </p><pre><code>set sholine "$tclr(-d10) [string toupper [strftime %A $lut]]S Top 10 - "</code></pre></div>Thanks for the fast help again <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8589">Foxman</a> — Thu Mar 08, 2007 3:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-03-08T15:20:19-04:00</updated>

		<published>2007-03-08T15:20:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71099#p71099</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71099#p71099"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71099#p71099"><![CDATA[
Use lindex and string map, assuming your strftime returns something like:<br><br>Thursday, Month Day Year Time<br><br>You can do:<br><br>set  TDoDay [string map {Monday Maandag  Tuesday Dinsdag (and so on)} [lindex [split [strftime %A $lut] ,] 0]]<br><br>Check the manpage for 'string' to see how to use string map.<br>Note the comma in the [split] command, if your strftime uses a comma after the day of week, otherwise [split [strftime %A $lut]] should do the trick. The way I did the line above stacks all of the commands into 1 line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Thu Mar 08, 2007 3:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2007-03-08T15:16:05-04:00</updated>

		<published>2007-03-08T15:16:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71098#p71098</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71098#p71098"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71098#p71098"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set nameOfDay [string map {Sunday    Zondag Monday    MaandagTuesday   DinsdagWednesday WoensdagThursday  DonderdagFriday    VrijdagSaturday  Zaterdag} [strftime %A $lut]]</code></pre></div>or use %w to get the day of week as an integer (0-6, 0 being sunday):<div class="codebox"><p>Code: </p><pre><code>set nameOfDay [lindex {Zondag Maandag Dinsdag Woensdag Donderdag Vrijdag Zaterdag} [clock format $lut -format %w]]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Mar 08, 2007 3:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Foxman]]></name></author>
		<updated>2007-03-08T13:21:51-04:00</updated>

		<published>2007-03-08T13:21:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71089#p71089</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71089#p71089"/>
		<title type="html"><![CDATA[How to Replace WEEKDAY to another Language in tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71089#p71089"><![CDATA[
I've translated a script to Dutch (BogusTrivia) all good...<br><br>But i would also like to tranlate the Weekday's in the script the day's are called like this:<br><div class="codebox"><p>Code: </p><pre><code>[strftime %A $lut]</code></pre></div>This will show: sunday, monday, tuesday, wednesday, thursday, friday or saturday<br><br>I thought doing something like:<br><div class="codebox"><p>Code: </p><pre><code>[TDoDay [strftime %A $lut]]proc TDoDay {} {  Sunday {  return Zondag  }  Monday {  return Maandag  }  Tuesday {  return Dinsdag  }  Wednesday {  return Woensdag  }  Thursday {  return Donderdag  }  Friday {  return Vrijdag }  Saturday {  return Zaterdag  } }</code></pre></div>would do the thrick, but it doesn't work so far.<br><br>Does anyone have a suggestion on how to make this work?<br>Thank you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8589">Foxman</a> — Thu Mar 08, 2007 1:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
