Files
RedBear-OS/recipes/tools/gettext/source/gettext-tools/doc/lang-tcl.texi
T
vasilito facf0c92e0 feat: track all source trees in git — full fork offline-first model
Red Bear OS is a full fork. All sources must be available from git clone
with zero network access. Removed gitignore rules that excluded fetched
source trees under recipes/*/source/, local/recipes/kde/*/source/,
local/recipes/qt/*/source/, and vendor source trees.

Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded.

127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt
frameworks, mesa, wayland, DRM drivers, and every other recipe source.
2026-05-14 10:55:53 +01:00

71 lines
1.6 KiB
Plaintext

@c This file is part of the GNU gettext manual.
@c Copyright (C) 1995-2020 Free Software Foundation, Inc.
@c See the file gettext.texi for copying conditions.
@node Tcl
@subsection Tcl - Tk's scripting language
@cindex Tcl
@cindex Tk's scripting language
@table @asis
@item RPMs
tcl
@item Ubuntu packages
tcl
@item File extension
@code{tcl}
@item String syntax
@code{"abc"}
@item gettext shorthand
@code{[_ "abc"]}
@item gettext/ngettext functions
@code{::msgcat::mc}
@item textdomain
---
@item bindtextdomain
---, use @code{::msgcat::mcload} instead
@item setlocale
automatic, uses LANG, but ignores LC_MESSAGES and LC_ALL
@item Prerequisite
@code{package require msgcat}
@*@code{proc _ @{s@} @{return [::msgcat::mc $s]@}}
@item Use or emulate GNU gettext
---, uses a Tcl specific message catalog format
@item Extractor
@code{xgettext -k_}
@item Formatting with positions
@code{format "%2\$d %1\$d"}
@item Portability
fully portable
@item po-mode marking
---
@end table
Two examples are available in the @file{examples} directory:
@code{hello-tcl}, @code{hello-tcl-tk}.
Before marking strings as internationalizable, substitutions of variables
into the string need to be converted to @code{format} applications. For
example, @code{"file $filename not found"} becomes
@code{[format "file %s not found" $filename]}.
Only after this is done, can the strings be marked and extracted.
After marking, this example becomes
@code{[format [_ "file %s not found"] $filename]} or
@code{[msgcat::mc "file %s not found" $filename]}. Note that the
@code{msgcat::mc} function implicitly calls @code{format} when more than one
argument is given.