proc n2n s { return [string index $s 0][string length [string range $s 1 end-1]][string index $s end] } % n2n internationalization i18n % n2n localization l10nAMG: I'd avoid generating the substring only to take its length:
proc n2n {s} { return [string index $s 0][expr {[string length $s] - 2}][string index $s end] }
Tcl/Tk is an excellent base for i18n, with Unicode, encoding support, and Tk's automatic font finding. In another take at localization (l10n), the community has collected a number of translations of the constitutional Tcl man page - see Endekalogue.
The i18n package contains most of what RS has done in i18n so far.
i18n - writing for the world or, newer, i18n - Tcl for the world
Introduction to i18n: http://www.debian.org/doc/manuals/intro-i18n/http://www.tcl.tk/doc/howto/i18n.html
See Also edit
- msgcat - TCL's localization tools