Version 3 of msgcat magic

Updated 2007-02-26 18:59:32

On the 22. Aug 2002 an interesting usage for the msgcat package has been discussed briefly in the Tcl chatroom.

Normally msgcat just translates messages, but you can use it to translate, for example, proc names and switch between locale-specific procs with this.

Example:

     package require msgcat
     mc::mcset en "l10nproc:foo" "foo_en"
     mc::mcset de "l10nproc:foo" "foo_de"

     proc foo_en {} {
        puts "some english text"
     }

     proc foo_de {} {
        puts "etwas deutscher text"
     }

     [mc i10nproc:foo]

There is a risk however, if you pass your .msg files to unknowing translators who mess things up.


Category Porting - Category Local