#emc-devel | Logs for 2006-04-10

[15:22:56] <SkunkWorks> sourceforge
[15:23:01] <SkunkWorks> is down
[15:26:08] <SkunkWorks> well now it is "kinda" working
[15:41:55] <jepler> SkunkWorks: what are you trying to do on SF?
[15:44:59] <jepler> should we put a note on sf that the CVS has moved?
[15:45:15] <cradek> I think I can actually turn it off, let me try
[15:47:36] <cradek> Availability of CVS data will not be affected by this setting. If you have data in your project CVS repository and this service is disabled, CVS operations may still be performed; however, the "CVS" menu option on your project page will not be displayed.
[15:48:09] <cradek> hmm.
[15:50:18] <jepler> sounds like a start
[15:50:26] <cradek> yeah, done
[15:51:32] <alex_joni> hello
[15:51:39] <cradek> hi alex
[15:51:54] <alex_joni> hey chris, that sounds like a smart move
[15:51:55] <alex_joni> :)
[15:52:39] <cradek> maybe we should also change a key file or two so you can't accidentally build it thinking you have the latest
[15:52:55] <jepler> make ./configure error out?
[15:52:56] <alex_joni> how about removing configure?
[15:53:08] <alex_joni> or replace it with a simple bash script
[15:53:19] <alex_joni> printing an error message, and what to do to get the latest CVS
[15:53:20] <cradek> any of those sound good
[15:53:26] <cradek> agreed
[15:54:03] <jepler> #!/bin/sh \n echo "emc2 CVS has moved to ... see ... for more information" \n exit 1
[15:54:12] <alex_joni> yeah.. I can do that
[15:54:17] <cradek> thanks
[15:54:37] <alex_joni> give me 10 mins
[15:57:41] <SkunkWorks> I was just looking at the mail (dev/users)
[16:01:33] <alex_joni> SkunkWorks: care to tell us what you've seen?
[16:02:10] <SkunkWorks> I could not get there to begin with - "page cannot be displayed" now it is running slow but working.
[16:02:25] <SkunkWorks> I could just be me ;)
[16:05:31] <jepler> Truer words were never typed: <SkunkWorks> I could just be me ;
[16:05:34] <jepler> )
[16:07:45] <SkunkWorks> :)
[16:07:56] <alex_joni> that is true for most of us
[16:08:00] <alex_joni> cradek: done
[16:20:55] <cradek> thank you
[17:51:28] <alex_joni> jepler: are you around?
[18:29:14] <jepler> alex_joni: just got back from lunch
[18:31:30] <alex_joni> hi
[18:31:37] <alex_joni> * alex_joni has a nice topic for you
[18:32:05] <alex_joni> i18n, L10n and such
[18:32:32] <alex_joni> as you have done quite a good deal on AXIS, I was thinking you might share some tricks ;)
[18:32:33] <cradek> don't warn him, you should just ask before scaring him away
[18:32:51] <alex_joni> cradek: was thinking of asking nicely
[18:33:28] <alex_joni> but you were right.. I scared him away :((
[18:35:41] <jepler> well I don't know any "tricks".
[18:35:49] <jepler> what part are you asking about, specifically?
[18:37:57] <alex_joni> 1. compiling .po files & installing them to the right spot
[18:38:31] <alex_joni> 2. using gettext style translations from tcl, or how to sort the mess of $(LANG).msg
[18:39:16] <jepler> Python supports gettext-style .. I let tcl call the Python "_" function. It wouldn't work in a pure tcl application
[18:41:38] <cradek> -- MsgcatToPo Automatically converts msgcat-format files created with Extract_MsgCat to po-format.
[18:42:11] <alex_joni> cradek: that's the easy part
[18:42:19] <alex_joni> the problem is using the gettext stuff from tcl
[18:42:31] <alex_joni> I can't seem to find any example for doing that
[18:44:41] <cradek> alex_joni: http://groups.yahoo.com/group/tcl_announce/message/1750
[18:49:19] <alex_joni> A set of developer tools ('msgmerge', 'msgfmt') that check the
[18:49:19] <alex_joni> translations coming from the translators and convert them to the Tcl
[18:49:20] <alex_joni> .msg catalog format.
[18:49:30] <alex_joni> so we're still stuck with the .msg stuff
[18:50:02] <alex_joni> * alex_joni thinks about installing *.msg to /usr/share/locale/
[18:51:02] <jepler> I think it should go under "share" but I'm not sure it should go in locale/ since it's not in the mo format
[18:51:14] <cradek> logger_devel: bookmark
[18:51:14] <cradek> See http://solaris.cs.utt.ro/irc/irc.freenode.net:6667/emcdevel/2006-04-10#T18-51-14
[18:51:32] <alex_joni> jepler: in locale/ it should go into the proper LANG
[18:51:38] <alex_joni> but that's not appropiate for tcl
[18:51:47] <alex_joni> so I think share is also a good choice
[18:52:31] <alex_joni> but the mo should definately go to the default place, hope you don't mind if I take a peek at AXIS cvs how you do that..
[18:53:21] <cradek> /usr/lib/tk8.4/msgs/de.msg
[18:53:32] <cradek> tk puts their own here
[18:53:38] <alex_joni> ok, so we should do the same
[18:53:41] <cradek> pretty sloppy
[18:53:47] <alex_joni> /usr/share/emc2/tcl/msgs
[18:54:02] <alex_joni> cradek: it's tcl, what do you expect?
[18:54:04] <cradek> yes probably
[18:54:12] <cradek> /usr/share/emc/tcl/msgs
[18:54:22] <alex_joni> yeah,. whatever :)
[18:55:37] <jepler> this incredibly hard-to-understand piece of code is what sets the location for the .mo files:
[18:55:41] <jepler> i18n = [(os.path.join(LOCALEDIR,lang(f),"LC_MESSAGES"), [(f, "axis.mo")])
[18:55:43] <jepler> for f in glob("i18n/??.mo") + glob("i18n/??_??.mo")]
[18:55:49] <jepler> having to read it again, I'd say whoever wrote that should be shot, except it was me.
[18:56:12] <alex_joni> * alex_joni looks away
[18:56:39] <alex_joni> but laughs a crazy laugh first..
[18:56:46] <jepler> oh, and I didn't even show the definition for the 'lang' function
[18:57:07] <alex_joni> spare us :D
[18:57:53] <alex_joni> jepler: this should be simple stuff
[18:58:03] <alex_joni> too bad the people who develop this don't have a clue
[18:58:08] <jepler> which "this" do you mean?
[18:58:12] <alex_joni> i18n
[18:58:15] <alex_joni> generally
[18:58:31] <alex_joni> pygettext & co even
[18:58:53] <jepler> I think I'm pretty clueless .. I just fumbled my way around 'till the messages started coming up in languages I couldn't read.
[18:59:20] <alex_joni> same here, except I could read the messages
[19:05:00] <alex_joni> cradek: still there?
[19:05:07] <cradek> yes
[19:05:15] <alex_joni> small bug in the CIA log
[19:05:34] <alex_joni> I just commited a change to a few tcl files, but only the first 2 were reported
[19:05:44] <alex_joni> the others were in tcl/bin and tcl/scripts
[19:05:55] <alex_joni> err.. only in tcl/bin
[19:05:58] <alex_joni> 4 more files..
[19:06:09] <alex_joni> it's not very important though.. just wanted to point it out
[19:07:43] <cradek> I also haven't seen the emc2/tcl/bin cia message yet
[19:07:47] <cradek> the other ones came through
[19:07:58] <alex_joni> it was on the same commit
[19:08:09] <cradek> doesn't matter, a separate one is sent for each directory
[19:08:13] <alex_joni> right
[19:08:27] <alex_joni> well.. only the first one was sent?
[19:09:05] <cradek> did you get any funny output from your cvs invocation?
[19:09:45] <alex_joni> no, all looked ok
[19:09:51] <alex_joni> I can paste if you like..
[19:10:06] <cradek> nah, that's ok if there was nothing there
[19:10:11] <alex_joni> nope
[19:11:59] <cradek> probably cia rejected it because the * or ' made the xml invalid or something
[19:12:19] <alex_joni> hmm.. then why did it work the first time?
[19:12:23] <cradek> I'm no expert on that but it obviously makes it through my script ok (since it's fine in the email)
[19:12:37] <alex_joni> it worked for tcl/
[19:12:42] <cradek> oh good question
[19:12:43] <alex_joni> it didn't work for tcl/bin/
[19:12:44] <cradek> that must not be it
[19:13:00] <alex_joni> ahh heck, don't waste time on it :)
[19:14:57] <alex_joni> hrmm.. might have found a small bug on make install, can you confirm?
[19:15:14] <alex_joni> I see an empty dir called configs along with sample-configs gets created
[19:15:28] <alex_joni> it's in /usr/local/etc/emc2/ by default
[19:18:23] <alex_joni> any reason to still have that?
[19:18:41] <alex_joni> $(DIR) $(DESTDIR)/usr/local/etc/emc2/configs
[19:19:46] <jepler> Unless they're inside a <TAG>, I don't think * or ' need to be quoted in xml
[19:20:23] <alex_joni> hrmm.. I just commited a change on Makefile.. didn't show in CIA either
[19:20:37] <alex_joni> cvs commit -m "installing tcl msgs to the proper place" Makefile
[19:20:37] <alex_joni> Checking in Makefile;
[19:20:37] <alex_joni> /cvs/emc2/src/Makefile,v <-- Makefile
[19:20:37] <alex_joni> new revision: 1.89; previous revision: 1.88
[19:20:37] <alex_joni> done
[19:22:14] <cradek> alex_joni: I made that directory on purpose
[19:22:59] <alex_joni> cradek: ok, didn't know what that was about.. was afraid it was forgotten from older times
[19:23:31] <cradek> that's where the system-wide configs can go
[19:23:54] <alex_joni> ok, never mind :)
[19:24:08] <alex_joni> just stumbled upon, and thought I'd better ask
[19:24:23] <alex_joni> we used to have configs in there..
[19:27:13] <alex_joni> jepler: need a bit of help on the build system
[19:27:28] <alex_joni> I want to compile the .po into .mo
[19:27:46] <alex_joni> so I added a src/po/Submakefile
[19:28:11] <alex_joni> then added po to the list of folders that Makefile searches for Submakefiles
[19:28:16] <jepler> OK sounds good so far
[19:28:22] <alex_joni> SUBDIRS iirc
[19:29:02] <alex_joni> give me 1 more minute to check the Submakefile if it is ok
[19:29:12] <alex_joni> can I make it a Makefile temporarely and test using make ?
[19:29:35] <jepler> probably not, because each Submakefile has to be written as if it was executing from the top directory
[19:29:46] <jepler> (because it is)
[19:29:52] <alex_joni> heh :)
[19:30:09] <alex_joni> I simply want a rule to call msgfmt -o
[19:30:15] <alex_joni> something like:
[19:30:22] <jepler> %.mo: %.po
[19:30:22] <jepler> msgfmt -o $@ $<
[19:30:26] <alex_joni> yeah, that
[19:30:39] <alex_joni> but also a default I think?
[19:30:49] <alex_joni> or how does make know what %.po is ?
[19:31:04] <jepler> In make rules, "%" is a wildcard
[19:31:13] <jepler> so it could match de.po or po/de.po
[19:31:36] <alex_joni> so, po/%.mo: po/%.po ?
[19:31:39] <jepler> no
[19:31:47] <jepler> because % can match the character "/"
[19:32:00] <alex_joni> I see.. so simply like that?
[19:32:05] <jepler> yeah I think so
[19:32:17] <alex_joni> make doesn't call it..
[19:32:37] <jepler> have you made the default target depend on the .mo files?
[19:32:46] <alex_joni> err.. no
[19:32:48] <jepler> just because make can make a target doesn't mean it does
[19:33:18] <jepler> something like: userspace: $(patsubst %.po, %.mo, $(wildcard po/*.po))
[19:33:41] <jepler> that will make the 'userspace' target depend on each mo file that could be made from the .po files in po/
[19:34:04] <alex_joni> ok, anywhere in the Makefile ?
[19:34:05] <jepler> or TARGETS += $(patsubst ...)
[19:34:18] <jepler> I'm not sure why I have TARGETS, frankly
[19:34:21] <alex_joni> ahh,, that makes more sense to me :)
[19:34:25] <alex_joni> I'll do that
[19:34:25] <jepler> there was some reason but now I've forgotten it
[19:36:39] <alex_joni> heh, now there is a de_rs274_err.mo
[19:36:49] <alex_joni> but it's still text ? is that normal?
[19:37:16] <alex_joni> hrmm.. seems like it
[19:37:34] <jepler> no, .mo is a binary format
[19:37:56] <alex_joni> then probably my editor knows how to convert :D
[19:38:02] <alex_joni> * alex_joni uses mc & mcedit
[19:38:30] <alex_joni> ok, less shows it as binary
[19:39:55] <alex_joni> cradek: CIA is not working anymore.. second commit which doesn't show up
[19:45:24] <jepler> alex_joni: You should add a rule to put the .mo files in the correct location for run-in-place, and put those filenames in TARGETS
[19:45:50] <jepler> ../share/tcl/msgs/%.mo: po/%.mo ; cp $< $@
[19:45:56] <jepler> something like that
[19:46:00] <jepler> and not tcl/msgs I guess
[19:46:07] <cradek> Apr 10 14:41:21 cvs sm-mta[84235]: k3AJfKKq084233: to=<cia@cia.navi.cx>, ctladdr=<cvs-adm@cvs.linuxcnc.org> (1002/1002), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=30562, relay=cia.navi.cx. [], dsn=2.0.0, stat=Sent (Ok: queued as 03BE31D8010)
[19:46:23] <cradek> alex_joni: I don't think the problem is on my end. It'll probably start working again.
[19:46:38] <cradek> yep CIA just fell off and then rejoined
[19:47:03] <alex_joni> jepler: the .mo are not tcl related
[19:47:44] <alex_joni> jepler: .mo and .po are standard gettext, and used in the interp
[19:48:06] <alex_joni> they only work if they get copied to /usr/share/locale/$(LANG)/...
[19:48:17] <alex_joni> at least if I'm getting this right..
[19:48:49] <jepler> they should only be copied to $(prefix)/share/... for run installed
[19:49:01] <alex_joni> right
[19:49:05] <jepler> they should be copied to some other location for run-in-place
[19:49:19] <jepler> and it's that location that should be listed in TARGETS
[19:49:21] <alex_joni> not sure if gettext can read the from some other location
[19:49:33] <alex_joni> s/the/them/
[19:49:33] <jepler> python's gettext can
[19:49:46] <alex_joni> how do you specify that?
[19:50:13] <jepler> in "C" you make a call to bindtextdomain(). One of the arguments is a directory name.
[19:50:58] <alex_joni> what about leaving them in src/po ?
[19:51:10] <alex_joni> why is that a bad choice?
[19:51:43] <jepler> my gut tells me that it doesn't make sense for any file in src/ to be required to run emc
[19:51:50] <jepler> gettext.install("axis", localedir=os.path.join(BASE, "share", "locale"), unicode=True)
[19:52:21] <jepler> ^^ this is how Python gets the .mo files from the right location. BASE is set based on the full path to the axis script
[19:52:30] <alex_joni> I see
[19:52:39] <jepler> so it's is /usr/bin/axis, then BASE is /usr and it gets messages from /usr/share/locale
[19:53:17] <alex_joni> I don't think rip & locale is 100% necessary
[19:53:30] <alex_joni> it only complicates stuff unnecessaryly
[19:54:24] <alex_joni> hmmm.. I see no bindtextdomain() call at all
[19:54:46] <jepler> I've never actually used the C gettext API
[19:55:15] <alex_joni> there is a define _(string) gettext(string)
[19:55:20] <alex_joni> so that might actually work
[19:57:26] <jepler> If all the source code knows how to find files relative to $(prefix), then making it work for RIP is just a matter of treating the top dir as $(prefix) and copying files to the right place
[19:57:52] <alex_joni> yes and no, because there are different dirs for rip and install
[19:58:04] <alex_joni> but I agree this can be handled somehow cleverly
[19:58:04] <jepler> If rip is good for developers, then it's good for "developers" of the message catalogs
[19:58:18] <alex_joni> maybe from config.h ?
[19:58:37] <alex_joni> have the location there, and only include it to the bindtextdomain() call
[19:58:48] <alex_joni> of course the location put there by configure
[19:58:54] <alex_joni> based on RIP or installed
[20:00:01] <jepler> my point is to make the RIP directory structure enough like the installed one so that no extra C code is needed to make the message catalogs work for RIP too
[20:00:05] <jepler> just an extra bit in the makefile
[20:01:04] <alex_joni> then I need $(emc2_topdir)/share/locale/de/LC_MESSAGES ?
[20:01:17] <alex_joni> as a place where to install the .mo ?
[20:02:11] <alex_joni> and I still need to get $(prefix) into the C code
[20:02:27] <jepler> you need to get $(prefix) in the C code no matter what
[20:03:57] <alex_joni> ok, just wanted to make sure we're talking about the same thing here :)
[20:04:59] <alex_joni> I need to digest this a bit better :(
[20:27:25] <alex_joni> wonder if I shoudl commit the version I have now, then do what you say later
[20:32:01] <jepler> sure, why not
[20:32:11] <alex_joni> already done it ;-)
[20:32:31] <alex_joni> think I'll head to bed early tonight (11:30PM now)
[20:32:45] <jepler> 'night
[20:32:58] <alex_joni> good night all
[20:33:19] <cradek> bye alex
[20:33:31] <cradek> if your changes work I might release tonight
[20:33:41] <alex_joni> I only made changes to HEAD
[20:33:50] <cradek> should I move them over?
[20:33:53] <alex_joni> if they are ok, I'll move to the branch
[20:33:58] <alex_joni> or you can..
[20:34:02] <cradek> ok
[20:34:04] <alex_joni> but who tests them?
[20:34:19] <cradek> I would I guess, it's a simple matter to try it
[20:34:33] <alex_joni> yeah.. guess so