[GRASS5] i18n for tcltkgrass

Alex Shevlakov alex at asrv.fcpf.ru
Fri May 17 08:40:07 EDT 2002


Hi all,

I'd like to attempt making permanent changes to tcltk scripts (especially,
tcltkgrass) code in order to internationalize them. As much as I know, there is a Tcl built-in 'msgcat' command allowing to internationalize messages. I have previously translated the whole package of tcltkgrass to Russian language and distributed it alone (http://motivation.ru/src). In order to have all i18n options in one distribution with GRASS, I think about some simple changes done, namely:

proc create_entry in gui.tcl to look like:

label $path.label$n -anchor w -padx 2 -text [::msgcat::mc $description]

instead of:

label $path.label$n -anchor w -padx 2 -text $description (change 1)

with two lines added in the beginning:

package require msgcat
::msgcat::mcload [file join [file dirname [info script]] msgs]

This would allow to read all messages in interface_build boxes (i.e., modules boxes) in NL, granted in the same directory with gui.tcl (i.e., main) there is a catalogue 'msgs' with files fr.msg, de.msg, ru.msg, etc. (all except for the subtitle description line in blue which I still have no idea how to).

The second needed change is (oh, long work) menu.tcl: replace all "strings"
with '::msgcat::mc "strings"'. This would make main menu in NL.
I just tested all these items to work fine on my computer (Linux TCL/Tk 8.3).

Any ideas/comments are welcome.

--alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20020517/f3438e59/attachment.bin


More information about the grass-dev mailing list