EpicNet.Ru - Форум IRC Чата

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Calendar - translate from English to Spanish


Calendar - translate from English to Spanish

Сообщений 1 страница 3 из 3

1

This is a working script to display the calendar:

Код:
alias calendar {
  set %calendar $iif($2,$1-,$asctime(mm yyyy))
  tokenize 32 %calendar

  var %s = $ctime($asctime(01/ $+ $1 $+ / $+ $2 $+ ) 0:00:00)

  window -aCfk0l20p @Calendar -1 -1 420 480
  clear @Calendar
  drawtext -r @Calendar $inv Fixedsys 25 10 10 $asctime(%s, mmmm yyyy)

  ;Draw the lines
  var %line = 60
  while (%line <= 420) {
    drawline -i @Calendar 1 1 0 %line 420 %line
    drawline -i @Calendar 1 1 %line 60 %line 480
    inc %line 60
  }

  ;Fill in day notations
  var %d = 1
  while ($x(%d).1) { drawcal $inv %d 1 $v1 | inc %d }

  ;Fill in day numbers
  var %m = $asctime(%s,m), %x, %y = 2
  while ($asctime(%s,m) = %m) {
    %x = $x($asctime(%s,ddd))
    drawcal $iif($gettask($asctime(%s,dd/mm/yyyy)),$xor($inv,255), $& 
      $iif($asctime(%s,dd mm) = $asctime(dd mm),$xor($inv,16711680),$inv)) %x %y $asctime(%s,dd)
    inc %s 86400
    if (%x = 7) inc %y
  }
}
menu @Calendar {
  sclick:{
    tokenize 32 %calendar
    var %s = $ctime($asctime(01/ $+ $1 $+ / $+ $2 $+ ) 0:00:00), %a = aline -l @Calendar $+($chr(3),01,$chr(44),00), %d = $& 
      $calc($int($calc(($mouse.x / 60) + 1)) - $x($asctime(%s,ddd)) + 1 + $int($calc(($mouse.y / 60) - 2)) * 7), $&
      %date = $+($base(%d,10,10,2),/,$base($1,10,10,2),/,$2)
    !.echo -q $$ctime(%date)

    clear -l @Calendar
    %a $+ %date | %a $+ Add Task | %a $+ -
    var %n = 1
    while ($gettask(%date,%n)) { %a $+ $v1 | inc %n }
  }
  lbclick:{
    if ($1 = 2) {
      var %task = $$input(Please add a task for this day:,e,Task Add)
      addtask $strip($line(@Calendar,1,1)) %task
      aline -l @Calendar $+($chr(3),01,$chr(44),00) $+ %task
      calendar %calendar
    }
    if ($1 > 3) {
      if ($input(Mark this task as done?,y,Delete?)) {
        deltask $strip($line(@Calendar,1,1)) $calc($1 - 3)
        dline -l @Calendar $1
        calendar %calendar
      }
    }
  }
  $submenu($month_menu($1))
}
alias -l month return $gettok(January February March April May June July August September October November December,$1,32)
alias -l x {
  var %days = Mon Tue Wed Thu Fri Sat Sun
  if ($prop) return $gettok(%days,$1,32)
  else return $findtok(%days,$1,1,32)
}
alias -l drawcal drawtext -cr @Calendar $1 Fixedsys 30 $calc(($2 - 1) * 60) $calc($3 * 60) 60 60 $4-
alias -l month_menu {
  if ($1 !isnum) return -
  if ($1 isnum 1-12) {
    var %m = $iif($calc(($asctime(mm) + $1 - 1) % 12),$v1,12), %y = $calc($asctime(yyyy) + $iif(%m < $asctime(mm),1))
    return $month(%m) $chr(40) $+ %y $+ $chr(41) $+ :calendar %m %y
  }
}
alias -l inv return $xor($color($color(background)),16777215)

;-- HASH STUFF --
on *:START:{
  .hmake Calendar 10
  if ($isfile($+(",$scriptdircalendar.hsh,"))) .hload Calendar $+(",$scriptdircalendar.hsh,")
  if ($gettask($asctime(dd/mm/yyyy))) {
    beep 10 50
    $iif($input(You still have $v1 tasks for today. Open Calendar?,y,Undone Tasks),calendar)
  }
}
on *:EXIT:if ($hget(Calendar)) hsave -o Calendar $+(",$scriptdircalendar.hsh,")
alias -l gettask {
  ;$gettask(dd/mm/yyyy,N)
  var %value = $hget(Calendar,$$1)
  if (!%value) return
  if (!$2) return $numtok(%value,32)
  return $hget(Calendar,$gettok(%value,$2,32))
}
alias -l addtask {
  hinc -m Calendar total
  hadd -m Calendar $1 $hget(Calendar,$1) $+(id,$hget(Calendar,total))
  hadd -m Calendar $+(id,$hget(Calendar,total)) $$2-
}
alias -l deltask {
  .hdel Calendar $gettok($hget(Calendar,$1),$2,32)
  hadd -m Calendar $1 $deltok($hget(Calendar,$1),$2,32)
}

This is not my code. I want to remake it so that the months and days are displayed in Spanish. I change this but it doesn't work ...

2

1260,351 написал(а):

I want to remake it so that the months and days are displayed in Spanish. I change this but it doesn't work ...

Это не работает, потому что скрипт использует встроенные идентификаторы, которые работают с названиями дней недели и месяцев исключительно только на английском языке.

Я переделал этот код так, чтобы он мог отображать вместо английского текста - испанский текст.
Кроме того, теперь можно изменить название дней недели и месяцев на любой другой удобный вам язык.

Попробуйте использовать эту модификацию скрипта:

Код:
# Mod v1.0 by Epic (http://epicnet.ru, irc.epicnet.ru:6667 #Code)
;-----------------------------------------------------------------------------------------
# Here you can specify the days of the week and months separated by spaces in your native language.
alias -l newmonth {
  var %newmonths = Enero Febrero Marzo Abril Mayo Junio ​​Julio Agosto Septiembre Octubre Noviembre Diciembre
  return $gettok(%newmonths,$1,32)
}
alias -l newdays {
  var %newdays = Lun Mar Mié Jue Vie Sáb Dom
  if ($prop) return $gettok(%newdays,$1,32)
  else return $findtok(%newdays,$1,1,32)
}
;-----------------------------------------------------------------------------------------
alias calendar {
  set %calendar $iif($2,$1-,$asctime(mm yyyy))
  tokenize 32 %calendar
  var %s = $ctime($asctime(01/ $+ $1 $+ / $+ $2 $+ ) 0:00:00)
  window -aCfk0l20p @Calendar -1 -1 420 480 | clear @Calendar
  var %date $asctime(%s, mmmm yyyy) | var %mmmm $gettok(%date,1,32) | var %yyyy $gettok(%date,2,32)
  var %i 1 | while (%i <= 12) { if ($month(%i) == %mmmm) { var %mmmm $newmonth(%i) | .break } | inc %i }
  drawtext -r @Calendar $inv Fixedsys 25 10 10 %mmmm %yyyy

  ;Draw the lines
  var %line = 60
  while (%line <= 420) {
    drawline -i @Calendar 1 1 0 %line 420 %line
    drawline -i @Calendar 1 1 %line 60 %line 480
    inc %line 60
  }

  ;Fill in day notations
  var %d = 1
  while ($newdays(%d).1) { drawcal $inv %d 1 $v1 | inc %d }

  ;Fill in day numbers
  var %m = $asctime(%s,m), %x, %y = 2
  while ($asctime(%s,m) = %m) {
    %x = $days($asctime(%s,ddd))
    drawcal $iif($gettask($asctime(%s,dd/mm/yyyy)),$xor($inv,255), $& 
      $iif($asctime(%s,dd mm) = $asctime(dd mm),$xor($inv,16711680),$inv)) %x %y $asctime(%s,dd)
    inc %s 86400
    if (%x = 7) inc %y
  }
}
menu @Calendar {
  sclick:{
    tokenize 32 %calendar
    var %s = $ctime($asctime(01/ $+ $1 $+ / $+ $2 $+ ) 0:00:00), %a = aline -l @Calendar $+($chr(3),01,$chr(44),00), %d = $& 
      $calc($int($calc(($mouse.x / 60) + 1)) - $days($asctime(%s,ddd)) + 1 + $int($calc(($mouse.y / 60) - 2)) * 7), $&
      %date = $+($base(%d,10,10,2),/,$base($1,10,10,2),/,$2)
    !.echo -q $$ctime(%date)

    clear -l @Calendar
    %a $+ %date | %a $+ Agregar tarea | %a $+ -
    var %n = 1
    while ($gettask(%date,%n)) { %a $+ $v1 | inc %n }
  }
  lbclick:{
    if ($1 = 2) {
      var %task = $$input(Agregue una tarea para este día:,e,Agregar tarea)
      addtask $strip($line(@Calendar,1,1)) %task
      aline -l @Calendar $+($chr(3),01,$chr(44),00) $+ %task
      calendar %calendar
    }
    if ($1 > 3) {
      if ($input(Mark this task as done?,y,Delete?)) {
        deltask $strip($line(@Calendar,1,1)) $calc($1 - 3)
        dline -l @Calendar $1
        calendar %calendar
      }
    }
  }
  $submenu($month_menu($1))
}
alias -l month return $gettok(January February March April May June July August September October November December,$1,32)
alias -l days {
  var %days = Mon Tue Wed Thu Fri Sat Sun
  if ($prop) return $gettok(%days,$1,32)
  else return $findtok(%days,$1,1,32)
}
alias -l drawcal drawtext -cr @Calendar $1 Fixedsys 30 $calc(($2 - 1) * 60) $calc($3 * 60) 60 60 $4-
alias -l month_menu {
  if ($1 !isnum) return -
  if ($1 isnum 1-12) {
    var %m = $iif($calc(($asctime(mm) + $1 - 1) % 12),$v1,12), %y = $calc($asctime(yyyy) + $iif(%m < $asctime(mm),1))
    return $newmonth(%m) $chr(40) $+ %y $+ $chr(41) $+ :calendar %m %y
  }
}
alias -l inv return $xor($color($color(background)),16777215)

;-- HASH STUFF --
on *:START:{
  .hmake Calendar 10
  if ($isfile($+(",$scriptdircalendar.hsh,"))) .hload Calendar $+(",$scriptdircalendar.hsh,")
  if ($gettask($asctime(dd/mm/yyyy))) {
    beep 10 50
    $iif($input(You still have $v1 tasks for today. Open Calendar?,y,Undone Tasks),calendar)
  }
}
on *:EXIT:if ($hget(Calendar)) hsave -o Calendar $+(",$scriptdircalendar.hsh,")
alias -l gettask {
  ;$gettask(dd/mm/yyyy,N)
  var %value = $hget(Calendar,$$1)
  if (!%value) return
  if (!$2) return $numtok(%value,32)
  return $hget(Calendar,$gettok(%value,$2,32))
}
alias -l addtask {
  hinc -m Calendar total
  hadd -m Calendar $1 $hget(Calendar,$1) $+(id,$hget(Calendar,total))
  hadd -m Calendar $+(id,$hget(Calendar,total)) $$2-
}
alias -l deltask {
  .hdel Calendar $gettok($hget(Calendar,$1),$2,32)
  hadd -m Calendar $1 $deltok($hget(Calendar,$1),$2,32)
}
Подпись автора

[html]<style>img {vertical-align:middle;}.hnet{color:#FFFFFF;}.hstar{color:#DE0000;}.htext{font-family:Verdana;font-size:13px;color:#6E1E00;}.heading{font-family:Verdana;font-size:13px;font-weight:bold;background-color:#4897E7;}.stitle{font-family:Verdana;font-size:12px;}.dot{color:#808000;}.desc{color:#ADADAD;}a .curl{font-family:Verdana;font-size:13px;color:#3A92CD;}</style><table><tr><td width="20px" height="20px"><img src="http://forumstatic.ru/files/000d/c9/8c/34681.jpg"></td><td><a href="http://forum.epicnet.ru/viewtopic.php?id=234"><span class="heading"> <span class="hstar">★</span> <span class="hnet">EpicNet.Ru</span> <span class="hstar">★</span> </span><span class="htext"> - IRC Чат © 2008</span></a></td></tr><tr><td></td><td><div class="stitle"><span class="dot">•</span> <span class="desc">Вход через вебгейт:</span> <a href="http://irc.epicnet.ru"><span class="curl">http://irc.epicnet.ru</span></a><br><span class="dot">•</span> <span class="desc">Сервер:</span> irc.epicnet.ru <span class="desc">Порты:</span> 6667, 6668 (ssl)<br><div></td></tr></table>[/html]

3

you are the best thnx so much!!!!


Вы здесь » EpicNet.Ru - Форум IRC Чата » HELP SCRIPTS - Помощь по mIRC скриптам » Calendar - translate from English to Spanish