[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

13.5.15 Tcl - Tk's scripting language

RPMs
tcl

File extension
tcl

String syntax
"abc"

gettext shorthand
[_ "abc"]

gettext/ngettext functions
::msgcat::mc

textdomain
---

bindtextdomain
---, use ::msgcat::mcload instead

setlocale
automatic, uses LANG, but ignores LC_MESSAGES and LC_ALL

Prerequisite
package require msgcat
proc _ {s} {return [::msgcat::mc $s]}

Use or emulate GNU gettext
---, uses a Tcl specific message catalog format

Extractor
xgettext -k_

Formatting with positions
format "%2\$d %1\$d"

Portability
fully portable

po-mode marking
---

Before marking strings as internationalizable, substitutions of variables into the string need to be converted to format applications. For example, "file $filename not found" becomes [format "file %s not found" $filename]. Only after this is done, can the strings be marked and extracted. After marking, this example becomes [format [_ "file %s not found"] $filename] or [msgcat::mc "file %s not found" $filename]. Note that the msgcat::mc function implicitly calls format when more than one argument is given.



This document was generated on May 6, 2002 using texi2html