egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ChanRelay 4.0 i18n
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 877
Location: France

PostPosted: Mon Apr 12, 2021 6:19 am    Post subject: ChanRelay 4.0 i18n Reply with quote

New version of chanrelay : https://gitlab.com/tcl-scripts/chanrelay/-/releases/chanrelay-4.0

Short changelog:
- Internationalisation (i18n) using msgcat
- All files (logs, settings, translations) are moved in crtools/ directory

Do not hesitate to transmit me corrections in translations (or correct directly in gitlab) or send me new languages
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 385

PostPosted: Mon Apr 12, 2021 5:19 pm    Post subject: Reply with quote

Awesome work CrazyCat, as always Wink
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
skydrome
Voice


Joined: 05 Apr 2021
Posts: 1

PostPosted: Wed Apr 28, 2021 3:53 am    Post subject: Reply with quote

Hello, Im confused as how the script sends the messages to the bots by its username.
My bot's user handles are theyre nicks and they have different usernames so [islinked $bot] is always false
Should i .+bot in a different manner?
Back to top
View user's profile Send private message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 877
Location: France

PostPosted: Wed Apr 28, 2021 11:06 am    Post subject: Reply with quote

Well, I did the script with the assertion that the bots are added using their username, which is often their botnet-nick too.
The better way is to make chanrelay working is to do the .+bot <username> when creating your botnet.
Note that the bot handle is just informative.

If you have troubles to set up chanrelay, I can make an adapted version of it for particular cases Smile
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri May 07, 2021 8:38 am    Post subject: Reply with quote

I'm having below error:-
Hope to get some help or advice on how to resolve it Smile
Thanks!
Code:

[06:40:45] Tcl error [::crelay::trans:topic]: expected integer but got "GREGORIAN_CHANGE_DATE"
[06:41:01] Tcl error [::crelay::trans:join]: expected integer but got "GREGORIAN_CHANGE_DATE"
[06:41:01] Tcl error [::crelay::trans:topic]: expected integer but got "GREGORIAN_CHANGE_DATE"
[06:41:01] Tcl error [::crelay::trans:pub]: expected integer but got "GREGORIAN_CHANGE_DATE"
[06:41:14] Tcl error [::crelay::trans:join]: expected integer but got "GREGORIAN_CHANGE_DATE"
[06:41:14] Tcl error [::crelay::trans:topic]: expected integer but got "GREGORIAN_CHANGE_DATE"
[06:42:09] Tcl error [::crelay::trans:part]: expected integer but got "GREGORIAN_CHANGE_DATE"
Back to top
View user's profile Send private message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 877
Location: France

PostPosted: Fri May 07, 2021 9:31 am    Post subject: Reply with quote

Please do a .set errorInfo in party-line just after having the error, it will give more informations about it

The error could be in the dlog procedure, you can try to set debug to 0
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri May 07, 2021 9:41 am    Post subject: Reply with quote

Hey CrazyCat, thanks for your prompt reply.
Here you go:-
Code:

Currently: expected integer but got "GREGORIAN_CHANGE_DATE"
Currently:     while executing
Currently: "GetDateFields $clockval  $TZData($timezone)  GREGORIAN_CHANGE_DATE"
Currently:     (procedure "::tcl::clock::formatproc'%Y-%m-%d %H\:%M\:%S'c" line 4)
Currently:     invoked from within
Currently: "$procName $clockval $timezone"
Currently:     (procedure "::tcl::clock::format" line 34)
Currently:     invoked from within
Currently: "clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S""
Currently:     (procedure "dlog" line 3)
Currently:     invoked from within
Currently: "dlog "Prepare transmission : >quit $chan $nick $text" "
Currently:     (procedure "::crelay::trans:quit" line 2)
Currently:     invoked from within
Currently: "::crelay::trans:quit $_stnm1 $_stnm2 $_stnm3 $_stnm4 $_stnm5"
Back to top
View user's profile Send private message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 877
Location: France

PostPosted: Fri May 07, 2021 9:44 am    Post subject: Reply with quote

Ok, it a trouble with the clock, so disable the debug.

I'll try to find a solution, this seems to be a known trouble with tcl
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 877
Location: France

PostPosted: Fri May 07, 2021 9:58 am    Post subject: Reply with quote

Ok, solution found Smile

replace the actual i18n proc with the following:
Code:
proc i18n {msgfile {lang {}} } {
   if {$lang == ""} {set lang [string range [::msgcat::mclocale] 0 1] }
   if { [catch {open $msgfile r} fmsg] } {
      putlog "\002ChanRelay\002 - Could not open $msgfile for reading\n$fmsg"
   } else {
      putlog "\002ChanRelay\002 - Loading $lang file from $msgfile"
      while {[gets $fmsg line] >= 0} {
         lappend ll $line
      }
      close $fmsg
      ::msgcat::mcmset $lang [join $ll]
      unset ll
   }
   ::msgcat::mclocale $lang
   # Hack for badly managed locales
   if { [::msgcat::mc GREGORIAN_CHANGE_DATE] == "GREGORIAN_CHANGE_DATE"} {
      ::msgcat::mcset [::msgcat::mclocale] GREGORIAN_CHANGE_DATE 2299527
   }
}


The trouble came from a trouble in msgcat and some timezones which are badly managed, I wonder you setted a language which is not in the original list Smile
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri May 07, 2021 10:04 am    Post subject: Reply with quote

Yeah the error is gone when I disable the debug, thanks!
But let's see if I'm able to get the relay to work Smile
Back to top
View user's profile Send private message
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri May 07, 2021 10:07 am    Post subject: Reply with quote

Wow that's fast you found the solution, I set the language to "english"
Back to top
View user's profile Send private message
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri May 07, 2021 10:31 am    Post subject: Reply with quote

I have replace the actual i18n proc with the following, but I still get the same error if I change back the debug mode to 1.
Code:

[09:27:06] Tcl error [::crelay::trans:pub]: expected integer but got "GREGORIAN_CHANGE_DATE"
[09:27:47] Tcl error [::crelay::trans:quit]: expected integer but got "GREGORIAN_CHANGE_DATE"
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3734
Location: Mint Factory

PostPosted: Fri May 07, 2021 10:41 am    Post subject: Reply with quote

Followed the error to the mc proc and I fail to understand what's is it's purpose.
Code:

proc mc {text {str ""} args} { return [format $text $str $args] }

given that it's use is:
Code:

if { [::msgcat::mc GREGORIAN_CHANGE_DATE] == "GREGORIAN_CHANGE_DATE"} {
      ::msgcat::mcset [::msgcat::mclocale] GREGORIAN_CHANGE_DATE 2299527
   }

Care to shed some light on it?
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 877
Location: France

PostPosted: Fri May 07, 2021 12:02 pm    Post subject: Reply with quote

If you setted english as lang, the error must not occure. And even if you don't have the english locale (I doubt of this), the hack I did must correct that.
BTW, I'll look a little bit more.
@vam2u: can you reload the script (.tcl source scripts/chanrelay.tcl) and copy here the message about the lang loading ?

@caesar: the proc I create is to fake msgcat when the package is not available (just return format without translation).
The hack I did in i18n is not applied if msgcat is absent, as i18n is called if the catch works.

Three cases occures:
1. msgcat is here and the locale is ok, the translation is done with msgcat
2. msgcat is absent, there is no translation and a simple format is applied
3. msgcat is here but the locale is missing/unknown, I force the GREGORIAN_CHANGE_DATE to the most used value
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
vam2u
Voice


Joined: 27 Mar 2021
Posts: 20
Location: Malaysia

PostPosted: Fri May 07, 2021 11:23 pm    Post subject: Reply with quote

@CrazyCat

Here you go, below is the message i get.

.tcl source scripts/chanrelay.tcl
[22:03:04] CHANRELAY 4.00 by CrazyCat loaded - https://www.eggdrop.fr
Tcl:
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber